From fb96d7437f5b4286d530a2e2b745884697af9dfe Mon Sep 17 00:00:00 2001 From: fomichev Date: Tue, 4 Feb 2025 18:02:01 +0300 Subject: [PATCH] =?utf8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD?= =?utf8?q?=D0=B8=D0=B5=20=D0=BF=D0=BE=D0=BB=D1=8F=20check=5Fid=5Flast=5Fsa?= =?utf8?q?le=20=D0=B2=20Users?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ...olumn_check_id_last_sale_to_user_table.php | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 erp24/migrations/m250204_143849_add_column_check_id_last_sale_to_user_table.php 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; + } + */ +} -- 2.39.5