From: fomichev Date: Tue, 4 Feb 2025 15:02:01 +0000 (+0300) Subject: Добавление поля check_id_last_sale в Users X-Git-Tag: 1.7~16^2~5 X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=fb96d7437f5b4286d530a2e2b745884697af9dfe;p=erp24_rep%2Fyii-erp24%2F.git Добавление поля check_id_last_sale в Users --- diff --git a/erp24/migrations/m250204_143849_add_column_check_id_last_sale_to_user_table.php b/erp24/migrations/m250204_143849_add_column_check_id_last_sale_to_user_table.php new file mode 100644 index 00000000..5cfa8d12 --- /dev/null +++ b/erp24/migrations/m250204_143849_add_column_check_id_last_sale_to_user_table.php @@ -0,0 +1,58 @@ +db->schema->getTableSchema(self::TABLE_NAME) === null) { + return; + } + + if ($this->db->schema->getTableSchema(self::TABLE_NAME)->getColumn('check_id_last_sale') === null) { + $this->addColumn( + self::TABLE_NAME, + 'check_id_last_sale', + $this->string()->null()->comment('GUID последнего чека'), + ); + } + + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + if ($this->db->schema->getTableSchema(self::TABLE_NAME) === null) { + return; + } + + if ($this->db->schema->getTableSchema(self::TABLE_NAME)->getColumn('check_id_last_sale') !== null) { + $this->dropColumn(self::TABLE_NAME, 'check_id_last_sale'); + } + } + + /* + // Use up()/down() to run migration code without a transaction. + public function up() + { + + } + + public function down() + { + echo "m250204_143849_add_column_check_id_last_sale_to_user_table cannot be reverted.\n"; + + return false; + } + */ +}