fixed bug

This commit is contained in:
JaguarJack 2020-04-22 22:47:31 +08:00
parent b3682b1ee6
commit e7295fa767
2 changed files with 13 additions and 9 deletions

View File

@ -28,12 +28,14 @@ class ChangePermissions extends Migrator
*/
public function change()
{
$table = $this->table('permissions');
if ($this->hasTable('permissions')) {
$table = $this->table('permissions');
$table->addColumn('component', 'string', ['default' => '', 'comment' => '组件名称', 'limit' => '255', 'after' => 'permission_mark'])
->addColumn('redirect', 'string', ['default' => '', 'comment' => '跳转地址', 'limit' => '255', 'after' => 'component'])
->addColumn('hide_children_in_menu', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY,'default'=> 1,'comment'=>'1 显示 2隐藏', 'after' => 'redirect'])
->addColumn('keep_alive', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY,'default'=> 1,'comment'=>'1 缓存 2 不存在 ', 'after' => 'hide_children_in_menu'])
->update();
$table->addColumn('component', 'string', ['default' => '', 'comment' => '组件名称', 'limit' => '255', 'after' => 'permission_mark'])
->addColumn('redirect', 'string', ['default' => '', 'comment' => '跳转地址', 'limit' => '255', 'after' => 'component'])
->addColumn('hide_children_in_menu', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, 'default' => 1, 'comment' => '1 显示 2隐藏', 'after' => 'redirect'])
->addColumn('keep_alive', 'integer', ['limit' => \Phinx\Db\Adapter\MysqlAdapter::INT_TINY, 'default' => 1, 'comment' => '1 缓存 2 不存在 ', 'after' => 'hide_children_in_menu'])
->update();
}
}
}

View File

@ -28,9 +28,11 @@ class PermissionsAddColumn extends Migrator
*/
public function change()
{
$table = $this->table('permissions');
if ($this->hasTable('permissions')) {
$table = $this->table('permissions');
$table->addColumn('level', 'string', ['default' => '', 'comment' => '层级', 'limit' => '50', 'after' => 'parent_id'])
->update();
$table->addColumn('level', 'string', ['default' => '', 'comment' => '层级', 'limit' => '50', 'after' => 'parent_id'])
->update();
}
}
}