refactor: 处理迁移文件
All checks were successful
Gitea Actions Official-website / deploy-dev (push) Successful in 3s

This commit is contained in:
2026-08-11 09:39:44 +08:00
parent e2d6718e9c
commit 751828be48

View File

@@ -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();
}
}