adding base db migrations.
This commit is contained in:
parent
3db175d542
commit
bf3d78da00
4 changed files with 134 additions and 0 deletions
34
app/migrations/20180321115827_create_user_table.php
Normal file
34
app/migrations/20180321115827_create_user_table.php
Normal 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();
|
||||
}
|
||||
}
|
||||
Reference in a new issue