]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
Изменение миграции и удаление новой
authorvladfo <fvv2011@gmail.com>
Fri, 18 Oct 2024 17:01:25 +0000 (20:01 +0300)
committervladfo <fvv2011@gmail.com>
Fri, 18 Oct 2024 17:01:25 +0000 (20:01 +0300)
erp24/migrations/m241015_125203_create_cluster_admin_table.php
erp24/migrations/m241018_114640_alter_table_cluster_admin_add_column_active.php [deleted file]

index ee4e5722fa4d6ea84a58bc3cdb10c058ba0cb91d..36374ebdb3f49900f563cd14e758b612e38d7251 100644 (file)
@@ -19,6 +19,7 @@ class m241015_125203_create_cluster_admin_table extends Migration
             'admin_id' => $this->integer()->notNull()->comment('ID пользователя'),
             'date_start' => $this->date()->notNull()->comment('Дата начала привязки'),
             'date_end' => $this->date()->defaultValue('2100-01-01')->notNull()->comment('Дата окончания привязки'),
+            'active' => $this->tinyInteger()->notNull()->defaultValue(0)->comment('0 - запись не активная 1 - запись привязки активная'),
         ]);
     }
 
diff --git a/erp24/migrations/m241018_114640_alter_table_cluster_admin_add_column_active.php b/erp24/migrations/m241018_114640_alter_table_cluster_admin_add_column_active.php
deleted file mode 100644 (file)
index c3e1a27..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-use yii\db\Migration;
-
-/**
- * Class m241018_114640_alter_table_cluster_admin_add_column_active
- */
-class m241018_114640_alter_table_cluster_admin_add_column_active extends Migration
-{
-    const TABLE_NAME = 'erp24.cluster_admin';
-    /**
-     * {@inheritdoc}
-     */
-    public function safeUp()
-    {
-        $this->addColumn(self::TABLE_NAME, 'active', $this->tinyInteger()->notNull()->defaultValue(0)
-            ->after('date_end')->comment('0 - запись не активная 1 - запись привязки активная'));
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function safeDown()
-    {
-        $this->dropColumn(self::TABLE_NAME, 'active');
-    }
-
-    /*
-    // Use up()/down() to run migration code without a transaction.
-    public function up()
-    {
-
-    }
-
-    public function down()
-    {
-        echo "m241018_114640_alter_table_cluster_admin_add_column_active cannot be reverted.\n";
-
-        return false;
-    }
-    */
-}