Permalink
ade990c Nov 4, 2016
2 contributors

Users who have contributed to this file

@bravo-kernel @codenpk
42 lines (39 sloc) 1.05 KB
<?php
use Phinx\Migration\AbstractMigration;
class Users extends AbstractMigration
{
public function up()
{
$table = $this->table('users');
$table
->addColumn('username', 'string', [
'default' => null,
'limit' => 50,
'null' => false
])
->addColumn('password', 'string', [
'default' => null,
'limit' => 255,
'null' => false
])
->addColumn('active', 'boolean', [
'default' => 0,
'null' => true
])
->addColumn('created', 'timestamp', [
'default' => 'CURRENT_TIMESTAMP',
'limit' => null,
'null' => false
])
->addColumn('modified', 'datetime', [
'default' => null,
'limit' => null,
'null' => true
])
->create();
}
public function down()
{
$this->dropTable('users');
}
}