modified 完善数据迁移脚本

This commit is contained in:
zhaoxiang 2020-03-18 18:01:54 +08:00
parent 40ca0ac3bf
commit 5804e919bb

View File

@ -27,16 +27,17 @@ class ChangeAdminMenuField extends Migrator {
*/
public function up() {
$this->table('admin_menu')
->removeColumn('hide')
->renameColumn('name', 'title')
->changeColumn('level', 'integer', [
'limit' => MysqlAdapter::INT_TINY,
'default' => 0,
'default' => 1,
'comment' => '菜单层级1-一级菜单2-二级菜单3-按钮'
])->addColumn('show', 'integer', [
'limit' => MysqlAdapter::INT_TINY,
'default' => 1,
'comment' => '是否显示1-显示0-隐藏'
])->update();
}
public function down() {
$this->table('admin_menu')->renameColumn('title', 'name')->update();
}
}