From: fomichev Date: Wed, 23 Apr 2025 09:28:31 +0000 (+0300) Subject: Поле delivery_to - миграция X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=879fdc2d2e3dc0474a4076067b3efbdecd7e0990;p=erp24_rep%2Fyii-erp24%2F.git Поле delivery_to - миграция --- diff --git a/erp24/migrations/m250423_092430_add_delivery_to_column_to_marketplace_orders_table.php b/erp24/migrations/m250423_092430_add_delivery_to_column_to_marketplace_orders_table.php new file mode 100644 index 00000000..48b26611 --- /dev/null +++ b/erp24/migrations/m250423_092430_add_delivery_to_column_to_marketplace_orders_table.php @@ -0,0 +1,39 @@ +db->schema->getTableSchema(self::TABLE_NAME); + if ($table === null) { + return; + } + + if (!$this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('delivery_to')) { + $this->addColumn( + self::TABLE_NAME, + 'delivery_to', + $this->text()->null()->comment('Сроки доставки заказа') + ); + } + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + if ($this->db->schema->getTableSchema(self::TABLE_NAME, true)->getColumn('delivery_to')) { + $this->dropColumn(self::TABLE_NAME, 'delivery_to'); + } + } +}