From: fomichev Date: Fri, 17 Apr 2026 13:25:56 +0000 (+0300) Subject: feat(ERP-292): миграция таблицы products_1c_automark_predictions X-Git-Url: https://gitweb.erp-flowers.ru/?a=commitdiff_plain;h=f54c8d694f3e3dfd5495cfffb3ec6c04a11f7e80;p=erp24_rep%2Fyii-erp24%2F.git feat(ERP-292): миграция таблицы products_1c_automark_predictions --- diff --git a/erp24/migrations/m260417_000001_create_products_1c_automark_predictions.php b/erp24/migrations/m260417_000001_create_products_1c_automark_predictions.php new file mode 100644 index 00000000..934b6963 --- /dev/null +++ b/erp24/migrations/m260417_000001_create_products_1c_automark_predictions.php @@ -0,0 +1,43 @@ +createTable('products_1c_automark_predictions', [ + 'id' => $this->primaryKey(), + 'product_id' => $this->string(36)->notNull(), + 'category' => $this->string(255)->null(), + 'subcategory' => $this->string(255)->null(), + 'species' => $this->string(255)->null(), + 'sort' => $this->string(255)->null(), + 'type' => $this->string(255)->null(), + 'size' => $this->integer()->null(), + 'color' => $this->string(255)->null(), + 'confidence' => $this->float()->notNull(), + 'method' => $this->string(50)->notNull(), + 'status' => $this->smallInteger()->notNull()->defaultValue(0), + 'approved_by' => $this->integer()->null(), + 'created_at' => $this->timestamp()->notNull()->defaultExpression('NOW()'), + 'updated_at' => $this->timestamp()->null(), + ]); + + $this->createIndex('idx_automark_product_id', 'products_1c_automark_predictions', 'product_id'); + $this->createIndex('idx_automark_status', 'products_1c_automark_predictions', 'status'); + $this->addForeignKey( + 'fk_automark_product', + 'products_1c_automark_predictions', 'product_id', + 'products_1c', 'id', + 'CASCADE', 'CASCADE' + ); + } + + public function safeDown(): void + { + $this->dropTable('products_1c_automark_predictions'); + } +}