Archived
1
0
Fork 0

adding base db migrations.

This commit is contained in:
Henrik Hautakoski 2018-03-21 19:12:35 +01:00
parent 3db175d542
commit bf3d78da00
4 changed files with 134 additions and 0 deletions

View file

@ -0,0 +1,34 @@
<?php
use Phinx\Migration\AbstractMigration;
class CreateUserTable extends AbstractMigration
{
public function up()
{
$table = $this->table('user');
$table->addColumn('username', 'string', [
'limit' => 50,
'null' => false
]);
$table->addColumn('email', 'string', [
'limit' => 255,
'null' => false
]);
$table->addColumn('status', 'enum', [
'null' => false,
'default' => 'Active',
'values' => [ 'Active', 'Deleted', 'Suspended']
]);
$table->addColumn('password', 'string', [
'limit' => 255,
'null' => true,
]);
$table->save();
}
}