From f75751bdfca9bdfa5d24bd490a9925819fae8c3c Mon Sep 17 00:00:00 2001 From: fomichev Date: Wed, 29 Jan 2025 18:02:46 +0300 Subject: [PATCH] =?utf8?q?=D0=A1=D0=BE=D0=B7=D0=B4=D0=B0=D0=BD=D0=B0=20?= =?utf8?q?=D0=BC=D0=B8=D0=B3=D1=80=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B4=D0=BB?= =?utf8?q?=D1=8F=20=D1=82=D0=B0=D0=B1=D0=BB=D0=B8=D1=86=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- ..._create_table_products_1c_nomenclature.php | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 erp24/migrations/m250129_144216_create_table_products_1c_nomenclature.php diff --git a/erp24/migrations/m250129_144216_create_table_products_1c_nomenclature.php b/erp24/migrations/m250129_144216_create_table_products_1c_nomenclature.php new file mode 100644 index 00000000..39677ba6 --- /dev/null +++ b/erp24/migrations/m250129_144216_create_table_products_1c_nomenclature.php @@ -0,0 +1,67 @@ +db->getTableSchema(self::TABLE_NAME); + + if (!isset($tableSchema)) { + $this->createTable(self::TABLE_NAME, [ + 'id' => $this->string()->notNull()->comment('GUID - уникальный номер номенклатуры в 1С'), + 'location' => $this->string() + ->notNull() + ->comment('расположение номенклатуры в системе 1С, т.е. путь до папки где храниться номенклатура'), + 'name' => $this->string() + ->notNull() + ->comment('имя номенклатуры'), + 'type_num' => $this->string() + ->notNull() + ->comment('Название вида номенклатуры из логического условия, без квадратных скобок.'), + 'category' => $this->string()->notNull()->comment('Категория'), + 'subcategory' => $this->string()->notNull()->comment('Подкатегория'), + 'species' => $this->string()->comment('Вид'), + 'sort' => $this->string()->comment('Сорт'), + 'size' => $this->integer()->comment('Размер'), + 'measure' => $this->string()->comment('Единица измерения'), + 'color' => $this->string()->comment('Цвет'), + 'PRIMARY KEY(id)', + ]); + } + } + + /** + * {@inheritdoc} + */ + public function safeDown() + { + $tableSchema = $this->db->getTableSchema(self::TABLE_NAME); + if (isset($tableSchema)) { + $this->dropTable(self::TABLE_NAME); + } + } + + /* + // Use up()/down() to run migration code without a transaction. + public function up() + { + + } + + public function down() + { + echo "m250129_144216_create_table_products_1c_nomenclature cannot be reverted.\n"; + + return false; + } + */ +} -- 2.39.5