|
|
|
@ -12,51 +12,51 @@ class Migration_create_users_table extends Migration
|
|
|
|
|
$config = new AauthConfig(); |
|
|
|
|
|
|
|
|
|
$this->forge->addField([ |
|
|
|
|
'id' => array( |
|
|
|
|
'id' => [ |
|
|
|
|
'type' => 'INT', |
|
|
|
|
'constraint' => 11, |
|
|
|
|
'unsigned' => TRUE, |
|
|
|
|
'auto_increment' => TRUE, |
|
|
|
|
), |
|
|
|
|
'email' => array( |
|
|
|
|
], |
|
|
|
|
'email' => [ |
|
|
|
|
'type' => 'VARCHAR', |
|
|
|
|
'constraint' => 254, |
|
|
|
|
), |
|
|
|
|
'username' => array( |
|
|
|
|
], |
|
|
|
|
'username' => [ |
|
|
|
|
'type' => 'VARCHAR', |
|
|
|
|
'constraint' => 150, |
|
|
|
|
'null' => TRUE, |
|
|
|
|
), |
|
|
|
|
'password' => array( |
|
|
|
|
], |
|
|
|
|
'password' => [ |
|
|
|
|
'type' => 'VARCHAR', |
|
|
|
|
'constraint' => 60, |
|
|
|
|
), |
|
|
|
|
'banned' => array( |
|
|
|
|
], |
|
|
|
|
'banned' => [ |
|
|
|
|
'type' => 'TINYINT', |
|
|
|
|
'constraint' => 1, |
|
|
|
|
'null' => TRUE, |
|
|
|
|
'default' => 0, |
|
|
|
|
), |
|
|
|
|
'created_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP', |
|
|
|
|
'updated_datetime DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP', |
|
|
|
|
'last_activity' => array( |
|
|
|
|
], |
|
|
|
|
'created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP', |
|
|
|
|
'updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP', |
|
|
|
|
'last_activity' => [ |
|
|
|
|
'type' => 'DATETIME', |
|
|
|
|
'default' => NULL, |
|
|
|
|
), |
|
|
|
|
'last_ip_address' => array( |
|
|
|
|
], |
|
|
|
|
'last_ip_address' => [ |
|
|
|
|
'type' => 'VARCHAR', |
|
|
|
|
'constraint' => 39, |
|
|
|
|
'default' => '', |
|
|
|
|
), |
|
|
|
|
'last_login' => array( |
|
|
|
|
], |
|
|
|
|
'last_login' => [ |
|
|
|
|
'type' => 'DATETIME', |
|
|
|
|
'default' => NULL, |
|
|
|
|
), |
|
|
|
|
'deleted' => array( |
|
|
|
|
], |
|
|
|
|
'deleted' => [ |
|
|
|
|
'type' => 'TINYINT', |
|
|
|
|
'constraint' => 1, |
|
|
|
|
'default' => 0, |
|
|
|
|
), |
|
|
|
|
], |
|
|
|
|
]); |
|
|
|
|
$this->forge->addKey('id', TRUE); |
|
|
|
|
$this->forge->createTable($config->dbTableUsers, TRUE); |
|
|
|
|