From: fomichev Date: Tue, 26 Nov 2024 15:41:18 +0000 (+0300) Subject: Миграция с доп полями products_1c X-Git-Tag: 1.7~215^2~10 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=6dfa2a42cf3ae79baf0ac3b6db107aa5eb709fbc;p=erp24_rep%2Fyii-erp24%2F.git Миграция с доп полями products_1c --- diff --git a/erp24/migrations/m241126_152940_add_fields_to_products_1c.php b/erp24/migrations/m241126_152940_add_fields_to_products_1c.php new file mode 100644 index 00000000..d3b55f24 --- /dev/null +++ b/erp24/migrations/m241126_152940_add_fields_to_products_1c.php @@ -0,0 +1,48 @@ +addColumn(self::TABLE_NAME, 'product_type', $this->string()->null()->comment('Вид номенклатуры')); + $this->addColumn(self::TABLE_NAME, 'country_of_origin', $this->string()->null()->comment('Страна происхождения')); + $this->addColumn(self::TABLE_NAME, 'manufacturer', $this->string()->null()->comment('Производитель')); + $this->addColumn(self::TABLE_NAME, 'brand', $this->string()->null()->comment('Бренд')); + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $this->dropColumn(self::TABLE_NAME, 'product_type'); + $this->dropColumn(self::TABLE_NAME, 'country_of_origin'); + $this->dropColumn(self::TABLE_NAME, 'manufacturer'); + $this->dropColumn(self::TABLE_NAME, 'brand'); + } + + /* + // Use up()/down() to run migration code without a transaction. + public function up() + { + + } + + public function down() + { + echo "m241126_152940_add_fields_to_products_1c cannot be reverted.\n"; + + return false; + } + */ +}