]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-302 Редактирование букета
authormarina <m.zozirova@gmail.com>
Tue, 4 Feb 2025 12:58:45 +0000 (15:58 +0300)
committermarina <m.zozirova@gmail.com>
Tue, 4 Feb 2025 12:58:45 +0000 (15:58 +0300)
erp24/migrations/m250203_094609_create_bouquets_tables.php [new file with mode: 0644]

diff --git a/erp24/migrations/m250203_094609_create_bouquets_tables.php b/erp24/migrations/m250203_094609_create_bouquets_tables.php
new file mode 100644 (file)
index 0000000..81d5b6c
--- /dev/null
@@ -0,0 +1,48 @@
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m250203_094609_create_bouquets_tables
+ */
+class m250203_094609_create_bouquets_tables extends Migration
+{
+    /**
+     * {@inheritdoc}
+     */
+    public function safeUp()
+    {
+        $this->createTable('erp24.bouquet_composition_products', [
+            'id' => $this->primaryKey(),
+            'bouquet_id' => $this->integer()->notNull()->comment('ID букета'),
+            'product_guid' => $this->string(255)->notNull()->comment('GUID продукта'),
+            'count' => $this->float()->comment('Количество продукта'),
+            'created_at' => $this->dateTime()->comment('Дата создания'),
+            'updated_at' => $this->dateTime()->comment('Дата обновления'),
+            'created_by' => $this->integer()->comment('ID создателя записи'),
+            'updated_by' => $this->integer()->comment('ID обновителя записи'),
+        ]);
+
+        $this->createTable('erp24.bouquet_composition', [
+            'id' => $this->primaryKey(),
+            'guid' => $this->string(255)->comment('GUID букета'),
+            'name' => $this->string(255)->notNull()->comment('Название букета'),
+            'matrix_type_id' => $this->integer()->comment('ИД типа матрицы'),
+            'photo_id' => $this->integer()->comment('ИД фото'),
+            'video_id' => $this->integer()->comment('ИД видео'),
+            'created_at' => $this->dateTime()->comment('Дата создания'),
+            'updated_at' => $this->dateTime()->comment('Дата обновления'),
+            'created_by' => $this->integer()->comment('ID создателя записи'),
+            'updated_by' => $this->integer()->comment('ID обновителя записи'),
+        ]);
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+        $this->dropTable('erp24.bouquet_composition_products');
+        $this->dropTable('erp24.bouquet_composition');
+    }
+}