refactor: 处理优化migration文件与model文件字段不一致
This commit is contained in:
@@ -35,6 +35,7 @@ class CreateProductTcoCategory extends Migrator
|
||||
->addColumn('tco_path', 'string', ['limit' => 120, 'default' => null, 'comment' => '产品目录分类上下级关联路径'])
|
||||
->addColumn('erp_id', 'integer', ['default' => null, 'comment' => '分类在ERP中的ID'])
|
||||
->addColumn('erp_pid', 'integer', ['default' => null, 'comment' => '分类在ERP中的父级ID'])
|
||||
->addColumn('erp_code', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '分类在ERP中的编码'])
|
||||
->addColumn('erp_path', 'string', ['limit' => 120, 'default' => null, 'comment' => '分类在ERP中的上下级关联路径'])
|
||||
->addColumn('disabled', 'boolean', ['null' => false, 'default' => 0, 'comment' => '0为启用, 1为禁用'])
|
||||
->addColumn('sync_time', 'integer', ['null' => false, 'default' => 0, 'comment' => '同步时间'])
|
||||
|
||||
@@ -31,6 +31,7 @@ class CreateArticleCategory extends Migrator
|
||||
$table = $this->table('article_category', ['engine' => 'MyISAM', 'comment' => '文章分类表']);
|
||||
$table->addColumn('language_id', 'integer', ['signed' => false, 'null' => false, 'comment' => '语言ID'])
|
||||
->addColumn('pid', 'integer', ['signed' => false, 'null' => false, 'default' => 0, 'comment' => '父级ID'])
|
||||
->addColumn('unique_label', 'string', ['limit' => 64, 'null' => false, 'comment' => '唯一标识'])
|
||||
->addColumn('name', 'string', ['limit' => 64, 'null' => false, 'comment' => '分类名称'])
|
||||
->addColumn('short_name', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '分类简称'])
|
||||
->addColumn('icon', 'string', ['limit' => 125, 'default' => null, 'comment' => '图标'])
|
||||
@@ -41,6 +42,7 @@ class CreateArticleCategory extends Migrator
|
||||
->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '新增时间'])
|
||||
->addColumn('updated_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'update' => 'CURRENT_TIMESTAMP', 'comment' => '更新时间'])
|
||||
->addColumn('deleted_at', 'timestamp', ['null' => true, 'comment' => '删除时间'])
|
||||
->addIndex(['language_id', 'unique_label'], ['name' => 'idx_language_id_unique_label', 'unique' => true])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,8 @@ class CreateAttachmentCategory extends Migrator
|
||||
public function change()
|
||||
{
|
||||
$table = $this->table('attachment_category', ['engine' => 'MyISAM', 'comment' => '附件分类表']);
|
||||
$table->addColumn('language_id', 'integer', ['signed' => false , 'null' => false, 'comment' => '语言ID'])
|
||||
$table->addColumn('pid', 'integer', ['null' => true, 'default' => 0, 'comment' => '上级id'])
|
||||
->addColumn('language_id', 'integer', ['signed' => false , 'null' => false, 'comment' => '语言ID'])
|
||||
->addColumn('name', 'string', ['limit' => 64 , 'null' => false, 'comment' => '分类名称'])
|
||||
->addColumn('sort', 'integer', ['null' => false, 'default' => 0, 'comment' => '排序'])
|
||||
->addColumn('is_show', 'boolean', ['null' => false, 'default' => 1, 'comment' => '是否显示:1是,0否'])
|
||||
|
||||
@@ -37,7 +37,7 @@ class CreateBulkPurchaseInquiry extends Migrator
|
||||
->addColumn('province', 'string', ['limit' => 64, 'null' => true, 'comment' => '省'])
|
||||
->addColumn('city', 'string', ['limit' => 64, 'null' => true, 'comment' => '市'])
|
||||
->addColumn('district', 'string', ['limit' => 64, 'null' => true, 'comment' => '区'])
|
||||
->addColumn('address', 'string', ['limit' => 255, 'null' => true, 'comment' => '地址'])
|
||||
->addColumn('street', 'string', ['limit' => 255, 'null' => true, 'comment' => '街道'])
|
||||
->addColumn('interested', 'string', ['limit' => 255, 'null' => false, 'comment' => '兴趣(感兴趣的产品品类)'])
|
||||
->addColumn('url', 'string', ['limit' => 255, 'null' => true, 'comment' => '感兴趣产品所在官网URL'])
|
||||
->addColumn('referer_url', 'string', ['limit' => 255, 'null' => true, 'comment' => '来源URL'])
|
||||
|
||||
@@ -31,14 +31,15 @@ class CreateSysConfig extends Migrator
|
||||
$table->addColumn('group_id', 'integer', ['limit' => 11, 'null' => false, 'comment' => '分组ID'])
|
||||
->addColumn('title', 'string', ['limit' => 64, 'null' => false, 'comment' => '配置标题'])
|
||||
->addColumn('name', 'string', ['limit' => 64, 'null' => false, 'comment' => '配置名称'])
|
||||
->addColumn('value', 'string', ['limit' => 512, 'null' => true, 'default' => null, 'comment' => '配置值'])
|
||||
->addColumn('extra', 'string', ['limit' => 512, 'null' => true, 'default' => null, 'comment' => '配置额外信息'])
|
||||
->addColumn('value', 'string', ['limit' => 4096, 'null' => true, 'default' => null, 'comment' => '配置值'])
|
||||
->addColumn('extra', 'string', ['limit' => 4096, 'null' => true, 'default' => null, 'comment' => '配置额外信息'])
|
||||
->addColumn('type', 'string', ['limit' => 64, 'null' => false, 'comment' => '配置类型: text, textarea, number, select, checkbox, radio, date, time, datetime'])
|
||||
->addColumn('sort', 'integer', ['limit' => 11, 'null' => false, 'default' => 0, 'comment' => '排序'])
|
||||
->addColumn('remark', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '备注'])
|
||||
->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addColumn('updated_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP', 'comment' => '更新时间'])
|
||||
->addIndex(['name'], ['unique' => true, 'name' => 'unique_idx_name'])
|
||||
->addColumn('deleted_at', 'timestamp', ['null' => true, 'default' => null, 'comment' => '删除时间'])
|
||||
->addIndex(['group_id', 'name'], ['unique' => true, 'name' => 'idx_unique_group_id_name'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,12 +29,13 @@ class CreateSysConfigGroup extends Migrator
|
||||
{
|
||||
$table = $this->table('sys_config_group', ['engine' => 'InnoDB', 'comment' => '系统配置分组表']);
|
||||
$table->addColumn('language_id', 'integer', ['null' => false, 'comment' => '语言ID'])
|
||||
->addColumn('unique_label', 'string', ['32' => 64, 'null' => true, 'default' => 'null', 'comment' => '唯一标识'])
|
||||
->addColumn('unique_label', 'string', ['limit' => 64, 'null' => true, 'default' => null, 'comment' => '唯一标识'])
|
||||
->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'comment' => '分组名称'])
|
||||
->addColumn('sort', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '排序'])
|
||||
->addColumn('status', 'boolean', ['limit' => 1, 'default' => 1, 'comment' => '状态 -1禁用, 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, 'default' => null, 'comment' => '删除时间'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ class CreateSysOperateLog extends Migrator
|
||||
->addColumn('status', MysqlAdapter::PHINX_TYPE_SMALL_INTEGER, ['limit' => 5, 'default' => 200, 'comment' => '状态码'])
|
||||
->addColumn('message', MysqlAdapter::PHINX_TYPE_TEXT, ['default' => null, 'comment' => '消息'])
|
||||
->addColumn('created_at', 'timestamp', ['null' => false, 'default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
|
||||
->addIndex(['user_id'], ['name' => 'idx_user_id'])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ class CreateSysNavigation extends Migrator
|
||||
$table = $this->table('sys_navigation', ['engine' => 'InnoDB', 'comment' => '系统导航表']);
|
||||
$table->addColumn('language_id', 'integer', ['null' => false, 'comment' => '语言ID'])
|
||||
->addColumn('at_page', 'string', ['limit' => 64, 'null' => true, 'comment' => '导航所在页面路径'])
|
||||
->addColumn('at_platform', 'string', ['limit' => 8, 'null' => false, 'comment' => '所在平台: pc为电脑, mobile为手机'])
|
||||
->addColumn('unique_label', 'string', ['limit' => 64, 'null' => false, 'comment' => '导航唯一标识'])
|
||||
->addColumn('name', 'string', ['limit' => 64, 'null' => false, 'comment' => '导航名称'])
|
||||
->addColumn('desc', 'string', ['limit' => 255, 'null' => true, 'default' => null, 'comment' => '导航描述'])
|
||||
@@ -38,7 +39,7 @@ class CreateSysNavigation extends Migrator
|
||||
->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, 'default' => null, 'comment' => '删除时间'])
|
||||
->addIndex(['unique_label'], ['unique' => true])
|
||||
->addIndex(['at_platform', 'language_id', 'unique_label'], ['name' => 'idx_at_platform_language_id_unique_label', 'unique' => true])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,6 @@ class CreateSysBanner extends Migrator
|
||||
$table->addColumn('language_id', 'integer', ['null' => false, 'comment' => '语言ID'])
|
||||
->addColumn('at_platform', 'string', ['limit' => 8, 'null' => false, 'comment' => '所在平台: pc为电脑, mobile为手机'])
|
||||
->addColumn('at_page', 'string', ['limit' => 255, 'null' => true, 'comment' => '所在页面'])
|
||||
->addColumn('at_position', 'string', ['limit' => 255, 'null' => true, 'comment' => '所在位置: top为顶部, footer为底部, left为左侧, right为右侧, center为中间'])
|
||||
->addColumn('unique_label', 'string', ['limit' => 64, 'null' => false, 'comment' => 'banner唯一标识'])
|
||||
->addColumn('name', 'string', ['limit' => 64, 'null' => false, 'comment' => 'banner名称'])
|
||||
->addColumn('desc', 'string', ['limit' => 255, 'null' => false, 'default' => '', 'comment' => 'banner描述'])
|
||||
@@ -41,7 +40,7 @@ class CreateSysBanner extends Migrator
|
||||
->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, 'default' => null, 'comment' => '删除时间'])
|
||||
->addIndex(['unique_label'], ['unique' => true])
|
||||
->addIndex(['at_platform', 'language_id', 'unique_label'], ['name' => 'idx_at_platform_language_id_unique_label', 'unique' => true])
|
||||
->create();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user