增】加默认值

This commit is contained in:
JaguarJack 2019-01-21 10:44:15 +08:00
parent 8a31920b9d
commit 8ba0301d03
2 changed files with 3 additions and 3 deletions

View File

@ -37,7 +37,7 @@ class Rbac extends Migrator
$table = $this->table(config('permissions.table.role'), [ 'engine'=>'InnoDB', 'comment' => '角色表']);
$table->addColumn('name', 'string',['limit' => 50, 'default'=>'','comment'=>'角色名称'])
->addColumn('created_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', [ 'comment' => '更新时间'])
->addColumn('updated_at', 'timestamp', [ 'default' => null,'comment' => '更新时间'])
->addIndex(['name'], ['unique' => true])
->create();
@ -50,7 +50,7 @@ class Rbac extends Migrator
->addColumn('action', 'string',['limit' => 50, 'default'=>'1','comment'=>'方法名称'])
->addColumn('is_show', 'integer',['limit' => MysqlAdapter::INT_TINY, 'default'=> 1,'comment'=>'1 展示 2 隐藏'])
->addColumn('created_at', 'timestamp', [ 'default' => 'CURRENT_TIMESTAMP','comment' => '创建时间'])
->addColumn('updated_at', 'timestamp', [ 'comment' => '更新时间'])
->addColumn('updated_at', 'timestamp', ['default' => null, 'comment' => '更新时间'])
->addIndex(['name'], ['unique' => true])
->create();

View File

@ -35,7 +35,7 @@ class Users extends Migrator
->addColumn('remember_token', 'string',['limit' => 255, 'default'=>'','comment'=>'记住token'])
->addColumn('login_ip', 'string',['limit' => 50, 'default'=>'','comment'=>'登录IP'])
->addColumn('created_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '更新时间'])
->addColumn('login_at', 'timestamp', [ 'comment' => '最近登录时间'])
->addColumn('login_at', 'timestamp', [ 'default' => null, 'comment' => '最近登录时间'])
->addIndex(['name', 'email'], ['unique' => true])
->create();
}