]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
изменил откат миграции и вернул cluster_id в миграцию m230905_161723
authorvladfo <fvv2011@gmail.com>
Fri, 18 Oct 2024 10:30:58 +0000 (13:30 +0300)
committervladfo <fvv2011@gmail.com>
Fri, 18 Oct 2024 10:30:58 +0000 (13:30 +0300)
erp24/migrations/m230905_161723_alter_table_city_store_add_column_square_store.php
erp24/migrations/m241018_065706_alter_table_city_store_drop_column_cluster_id.php

index 6a8e7946718edb90b017505acbfcd183566635f4..031ea3deb939f786afcb1bbd458c17c74f0488bc 100644 (file)
@@ -14,7 +14,7 @@ class m230905_161723_alter_table_city_store_add_column_square_store extends Migr
      */
     public function safeUp()
     {
-        $this->addColumn(self::TABLE_NAME, 'square_store', $this->integer(100)->null()->after('administrator_id'));
+        $this->addColumn(self::TABLE_NAME, 'square_store', $this->integer(100)->null()->after('cluster_id'));
     }
 
     /**
index 2d549a36f4cf8a606747cf3d1098d834be85ce6e..2fe883c05cd934c633e7f308ae886bafd8da9108 100644 (file)
@@ -26,7 +26,14 @@ class m241018_065706_alter_table_city_store_drop_column_cluster_id extends Migra
     public function safeDown()
     {
 
-        $this->addColumn(self::TABLE_NAME, 'cluster_id', $this->integer()->notNull()->after('administrator_id'));
+
+        $this->addColumn(self::TABLE_NAME, 'cluster_id', $this->integer()->after('administrator_id'));
+
+
+        $this->update(self::TABLE_NAME, ['cluster_id' => 0]);
+
+
+        $this->alterColumn(self::TABLE_NAME, 'cluster_id', $this->integer()->notNull());
     }
 
     /*