]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Добавил миграцию удаления
authorvladfo <fvv2011@gmail.com>
Fri, 18 Oct 2024 07:01:06 +0000 (10:01 +0300)
committervladfo <fvv2011@gmail.com>
Fri, 18 Oct 2024 07:01:06 +0000 (10:01 +0300)
erp24/migrations/m241018_065706_alter_table_city_store_drop_column_cluster_id.php [new file with mode: 0644]

diff --git a/erp24/migrations/m241018_065706_alter_table_city_store_drop_column_cluster_id.php b/erp24/migrations/m241018_065706_alter_table_city_store_drop_column_cluster_id.php
new file mode 100644 (file)
index 0000000..2d549a3
--- /dev/null
@@ -0,0 +1,46 @@
+<?php
+
+use yii\db\Migration;
+
+/**
+ * Class m241018_065706_alter_table_city_store_drop_column_cluster_id
+ */
+class m241018_065706_alter_table_city_store_drop_column_cluster_id extends Migration
+{
+    /**
+     * {@inheritdoc}
+     */
+    const TABLE_NAME = "city_store";
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeUp()
+    {
+        $this->dropColumn(self::TABLE_NAME, 'cluster_id');
+    }
+
+    /**
+     * {@inheritdoc}
+     */
+    public function safeDown()
+    {
+
+        $this->addColumn(self::TABLE_NAME, 'cluster_id', $this->integer()->notNull()->after('administrator_id'));
+    }
+
+    /*
+    // Use up()/down() to run migration code without a transaction.
+    public function up()
+    {
+
+    }
+
+    public function down()
+    {
+        echo "m241018_065706_alter_table_city_store_drop_column_cluster_id cannot be reverted.\n";
+
+        return false;
+    }
+    */
+}