12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class UpdateRoles extends Migrator
- {
-
- public function change()
- {
- if ($this->hasTable('roles')) {
- $table = $this->table('roles');
- $table->addColumn('identify', 'string', [
- 'limit' => 20,
- 'default' => 1,
- 'comment' => '角色的标识,用英文表示,用于后台路由权限',
- 'after' => 'role_name'])
- ->update();
- }
- }
- }
|