--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Handles the creation of table `{{%product_1c_prop_type}}`.
+ */
+class m241102_124933_create_product_1c_prop_type_table extends Migration
+{
+
+ const TABLE_NAME = 'erp24.product_1c_prop_type';
+ /**
+ * {@inheritdoc}
+ */
+ public function safeUp()
+ {
+ $this->createTable(self::TABLE_NAME, [
+ 'id' => $this->string()->notNull()->unique()->comment('Идентификатор из 1С'),
+ 'alias' => $this->string()->notNull()->comment('Алиас свойства'),
+ 'value' => $this->string()->notNull()->comment('Значение - например, "Срезка"'),
+ ]);
+
+ $this->addPrimaryKey('pk_product_1c_prop_type', self::TABLE_NAME, 'id');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ $this->dropTable(self::TABLE_NAME);
+ }
+}
--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Handles the creation of table `{{%product_1c_prop_value}}`.
+ */
+class m241102_124956_create_product_1c_prop_value_table extends Migration
+{
+
+ const TABLE_NAME = 'erp24.product_1c_prop_value';
+ /**
+ * {@inheritdoc}
+ */
+ public function safeUp()
+ {
+ $this->createTable(self::TABLE_NAME, [
+ 'id' => $this->string()->notNull()->unique()->comment('Идентификатор значения в системе 1С'),
+ 'prop_id' => $this->string()->notNull()->comment('Идентификатор свойства для которого присваивается значение'),
+ 'value_type' => $this->string()->notNull()->comment('Тип данных значения'),
+ 'value_string' => $this->string()->null()->comment('String '),
+ 'value_int' => $this->integer()->null()->comment('Integer'),
+ 'value_float' => $this->float()->null()->comment('Float'),
+ ]);
+
+ $this->addPrimaryKey('pk_product_1c_prop_value', self::TABLE_NAME, 'id');
+ $this->addForeignKey(
+ 'fk_product_1c_prop_value_prop_id',
+ self::TABLE_NAME,
+ 'prop_id',
+ '{{%erp24.product_1c_prop_type}}',
+ 'id',
+ 'CASCADE',
+ 'CASCADE'
+ );
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ $this->dropForeignKey('fk_product_1c_prop_value_prop_id', self::TABLE_NAME);
+ $this->dropTable(self::TABLE_NAME);
+
+ }
+}