--- /dev/null
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Handles the creation of table `{{%matrix_bouquet_actuality}}`.
+ */
+class m250908_123600_create_matrix_bouquet_actuality_table extends Migration
+{
+ /**
+ * {@inheritdoc}
+ */
+ const TABLE_NAME = 'erp24.matrix_bouquet_actuality';
+ /**
+ * {@inheritdoc}
+ */
+ public function safeUp()
+ {
+ $tableSchema = $this->db->getTableSchema(self::TABLE_NAME);
+
+ if (!isset($tableSchema)) {
+ $this->createTable(self::TABLE_NAME, [
+ 'id' => $this->primaryKey(),
+ 'guid' => $this->string()->notNull()->comment('GUID товара из 1С'),
+ 'bouquet_id' => $this->integer()->notNull()->comment('ID букета из bouquet_composition'),
+ 'date_from' => $this->dateTime()->notNull()->comment('Дата и время начала активности'),
+ 'date_to' => $this->dateTime()->null()->comment('Дата и время окончания активности'),
+ 'is_archive' => $this->tinyInteger()->defaultValue(0)->comment('Признак архивного товара'),
+ 'created_at' => $this->dateTime()->notNull()->comment('Дата создания'),
+ 'updated_at' => $this->dateTime()->null()->comment('Дата обновления'),
+ 'created_by' => $this->integer()->notNull()->comment('ИД создателя'),
+ 'updated_by' => $this->integer()->null()->comment('ИД редактировавшего'),
+ ]);
+ }
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function safeDown()
+ {
+ $tableSchema = $this->db->getTableSchema(self::TABLE_NAME);
+ if (isset($tableSchema)) {
+ $this->dropTable(self::TABLE_NAME);
+ }
+ }
+}