From 751828be4880fbf34e1f96986ebed5c57fbddb88 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Tue, 11 Aug 2026 09:39:44 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=A4=84=E7=90=86=E8=BF=81?= =?UTF-8?q?=E7=A7=BB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...707034159_create_product_compat_types.php} | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) rename database/migrations/{20260707034159_create_product_compat_rel.php => 20260707034159_create_product_compat_types.php} (50%) diff --git a/database/migrations/20260707034159_create_product_compat_rel.php b/database/migrations/20260707034159_create_product_compat_types.php similarity index 50% rename from database/migrations/20260707034159_create_product_compat_rel.php rename to database/migrations/20260707034159_create_product_compat_types.php index 37c9b264..88bd2393 100644 --- a/database/migrations/20260707034159_create_product_compat_rel.php +++ b/database/migrations/20260707034159_create_product_compat_types.php @@ -3,7 +3,7 @@ use think\migration\Migrator; use think\migration\db\Column; -class CreateProductCompatRel extends Migrator +class CreateProductCompatTypes extends Migrator { /** * Change Method. @@ -28,18 +28,20 @@ class CreateProductCompatRel extends Migrator */ public function change() { - $table = $this->table('product_compat_rel', [ - 'engine' => 'InnoDB', + $table = $this->table('product_compat_types', [ + 'engine' => 'MyISAM', 'collation' => 'utf8mb4_general_ci', - 'comment' => '产品兼容性关联表' + 'comment' => '产品兼容性-产品类型' ]); - $table->addColumn('product_id', 'integer', ['null' => false, 'comment' => '产品id']) - ->addColumn('compat_id', 'int', ['null' => false, 'comment' => '关联的兼容性数据id']) - ->addColumn('series_name', 'string', ['limit' => 128, 'null' => true, 'comment' => '产品系列名']) - ->addColumn('show_series_name', 'boolean', ['null' => false, 'default' => 0, 'comment' => '是否显示系列名:0=否,1=是']) - ->addColumn('remark', 'string', ['limit' => 512, 'null' => true, 'comment' => '兼容性说明']) + $table->addColumn('language_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '语言ID']) + ->addColumn('name', 'string', ['limit' => 128, 'null' => true, 'comment' => '类型名称']) + ->addColumn('sort', 'integer', ['default' => 0, 'comment' => '排序']) + ->addColumn('disabled', 'boolean', ['default' => 0, 'comment' => '是否禁用 0:启用 1:禁用']) ->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('updated_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 'comment' => '更新时间']) + ->addColumn('deleted_at', 'timestamp', ['null' => true, 'comment' => '删除时间']) + ->addIndex(['language_id'], ['name' => 'idx_language_id']) ->create(); } }