5 class m250717_080913_add_is_marketplace_allowed_editing_fields_to_marketplace_orders_1c_statuses_table extends Migration
7 const TABLE_NAME = 'erp24.marketplace_order_1c_statuses';
11 public function safeUp()
13 $table = $this->db->schema->getTableSchema(self::TABLE_NAME);
14 if ($table === null) {
18 if (!$this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('is_marketplace')) {
22 $this->integer()->defaultValue(1)->comment('Метка заказа из маркетплейса'),
25 if (!$this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('allowed_editing')) {
29 $this->integer()->defaultValue(1)->comment('Разрешено редактирование'),
37 public function safeDown()
39 if ($this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('is_marketplace')) {
40 $this->dropColumn(self::TABLE_NAME, 'is_marketplace');
42 if ($this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('allowed_editing')) {
43 $this->dropColumn(self::TABLE_NAME, 'allowed_editing');
48 // Use up()/down() to run migration code without a transaction.
54 public function down()
56 echo "m250717_080913_add_is_marketplace_allowed_editing_fields_to_marketplace_orders_1c_statuses_table cannot be reverted.\n";