modified 优化数据库迁移

This commit is contained in:
zhaoxiang 2020-03-18 16:56:06 +08:00
parent f93ce20eb0
commit 75a4a37bfc
3 changed files with 5 additions and 5 deletions

View File

@ -703,6 +703,6 @@ class IniAdminMenu extends Migrator {
] ]
]; ];
$this->table('admin_menu')->insert($data)->save(); $this->table('admin_menu')->insert($data)->saveData();
} }
} }

View File

@ -30,10 +30,10 @@ class AddAdminListField extends Migrator {
'limit' => MysqlAdapter::INT_TINY, 'limit' => MysqlAdapter::INT_TINY,
'default' => 2, 'default' => 2,
'comment' => '是否采用hash映射 1普通模式 2加密模式' 'comment' => '是否采用hash映射 1普通模式 2加密模式'
])->save(); ])->update();
} }
public function down() { public function down() {
$this->table('admin_list')->removeColumn('hash_type')->save(); $this->table('admin_list')->removeColumn('hash_type')->update();
} }
} }

View File

@ -25,11 +25,11 @@ class ChangeAdminMenuField extends Migrator {
* with the Table class. * with the Table class.
*/ */
public function up() { public function up() {
$this->table('admin_menu')->renameColumn('name', 'title')->save(); $this->table('admin_menu')->renameColumn('name', 'title')->update();
} }
public function down() { public function down() {
$this->table('admin_menu')->renameColumn('title', 'name')->save(); $this->table('admin_menu')->renameColumn('title', 'name')->update();
} }
} }