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,6 +28,7 @@ class ChangePermissions extends Migrator
*/ */
public function change() public function change()
{ {
if ($this->hasTable('permissions')) {
$table = $this->table('permissions'); $table = $this->table('permissions');
$table->addColumn('component', 'string', ['default' => '', 'comment' => '组件名称', 'limit' => '255', 'after' => 'permission_mark']) $table->addColumn('component', 'string', ['default' => '', 'comment' => '组件名称', 'limit' => '255', 'after' => 'permission_mark'])
@ -37,3 +38,4 @@ class ChangePermissions extends Migrator
->update(); ->update();
} }
} }
}

View File

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