--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Handles the creation of table `{{%marketplace_order_1c_statuses_relations}}`.
+ */
+class m250604_141110_create_marketplace_order_1c_statuses_relations_table extends Migration
+{
+ const TABLE_NAME = 'erp24.marketplace_order_1c_statuses_relations';
+ /**
+ * {@inheritdoc}
+ */
+ public function safeUp()
+ {
+ $tableSchema = $this->db->getTableSchema(self::TABLE_NAME);
+
+ if (!isset($tableSchema)) {
+ $this->createTable(self::TABLE_NAME, [
+ 'id' => $this->primaryKey(),
+
+ 'status_id_from' => $this->integer()->comment('Cтатус текущий - ссылка на id из таблицы marketplace_order_1c_statuses'),
+ 'status_id_to' => $this->integer()->comment('Cтатус для перехода - ссылка на id из таблицы marketplace_order_1c_statuses'),
+ 'description' => $this->text()->null()->comment('Описание для 1С'),
+ 'button_text' => $this->string()->null()->comment('Текст кнопки'),
+ 'created_at' => $this->dateTime()->comment('Дата создания'),
+ 'updated_at' => $this->dateTime()->comment('Дата обновления'),
+
+ ]);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ $tableSchema = $this->db->getTableSchema(self::TABLE_NAME);
+ if (isset($tableSchema)) {
+ $this->dropTable(self::TABLE_NAME);
+ }
+ }
+}
--- /dev/null
+<?php
+
+namespace yii_app\records;
+
+use Yii;
+
+/**
+ * This is the model class for table "marketplace_order_1c_statuses_relations".
+ *
+ * @property int $id
+ * @property int|null $status_id_from Cтатус текущий - ссылка на id из таблицы marketplace_order_1c_statuses
+ * @property int|null $status_id_to Cтатус для перехода - ссылка на id из таблицы marketplace_order_1c_statuses
+ * @property string|null $description Описание для 1С
+ * @property string|null $button_text Текст кнопки
+ * @property string|null $created_at Дата создания
+ * @property string|null $updated_at Дата обновления
+ */
+class MarketplaceOrder1cStatusesRelations extends \yii\db\ActiveRecord
+{
+
+
+ /**
+ * {@inheritdoc}
+ */
+ public static function tableName()
+ {
+ return 'marketplace_order_1c_statuses_relations';
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function rules()
+ {
+ return [
+ [['status_id_from', 'status_id_to', 'description', 'button_text', 'created_at', 'updated_at'], 'default', 'value' => null],
+ [['status_id_from', 'status_id_to'], 'default', 'value' => null],
+ [['status_id_from', 'status_id_to'], 'integer'],
+ [['description'], 'string'],
+ [['created_at', 'updated_at'], 'safe'],
+ [['button_text'], 'string', 'max' => 255],
+ ];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function attributeLabels()
+ {
+ return [
+ 'id' => 'ID',
+ 'status_id_from' => 'Status Id From',
+ 'status_id_to' => 'Status Id To',
+ 'description' => 'Description',
+ 'button_text' => 'Button Text',
+ 'created_at' => 'Created At',
+ 'updated_at' => 'Updated At',
+ ];
+ }
+
+}