migration: 20181003134001_user_type.php
This commit is contained in:
parent
da4f7a6f79
commit
ad2258607a
1 changed files with 19 additions and 0 deletions
19
app/migrations/20181003134001_user_type.php
Normal file
19
app/migrations/20181003134001_user_type.php
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
use Phinx\Migration\AbstractMigration;
|
||||||
|
|
||||||
|
class UserType extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
$this->table('user')
|
||||||
|
->addColumn('type', 'enum', [
|
||||||
|
'null' => false,
|
||||||
|
'default' => 'user',
|
||||||
|
'values' => [ 'user', 'admin' ],
|
||||||
|
'after' => 'regdate'
|
||||||
|
])
|
||||||
|
->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in a new issue