From: vladfo Date: Fri, 18 Oct 2024 10:30:58 +0000 (+0300) Subject: изменил откат миграции и вернул cluster_id в миграцию m230905_161723 X-Git-Tag: 1.6~30^2~5 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=7875280963cfce0cdcf205cbdce5ec02b98fa7f3;p=erp24_rep%2Fyii-erp24%2F.git изменил откат миграции и вернул cluster_id в миграцию m230905_161723 --- diff --git a/erp24/migrations/m230905_161723_alter_table_city_store_add_column_square_store.php b/erp24/migrations/m230905_161723_alter_table_city_store_add_column_square_store.php index 6a8e7946..031ea3de 100644 --- a/erp24/migrations/m230905_161723_alter_table_city_store_add_column_square_store.php +++ b/erp24/migrations/m230905_161723_alter_table_city_store_add_column_square_store.php @@ -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')); } /** 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 index 2d549a36..2fe883c0 100644 --- 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 @@ -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()); } /*