-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_users.php
23 lines (22 loc) · 981 Bytes
/
create_users.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
class CreateUser extends Migrations{
function _init_() {
$this->_fields = [
['field' => 'id', 'type' => 'INTEGER', 'autoincrement' => true, 'primary' => true],
['field'=>'email', 'type'=>'VARCHAR', 'null'=>'false', 'limit'=>'255'],
['field'=>'firstname', 'type'=>'VARCHAR', 'null'=>'false', 'limit'=>'75'],
['field'=>'lastname', 'type'=>'VARCHAR', 'null'=>'false', 'limit'=>'75'],
['field'=>'password', 'type'=>'VARCHAR', 'null'=>'true', 'limit'=>'255'],
['field' => 'status', 'type' => 'INTEGER', 'null' => FALSE, 'default'=>'0'],
['field' => 'created_at', 'type' => 'INTEGER', 'null' => FALSE, 'default'=>'0'],
['field' => 'updated_at', 'type' => 'INTEGER', 'null' => FALSE, 'default'=>'0']
];
}
function up(){
$this->Create_Table();
$this->Add_Single_Index('email');
}
function down(){
$this->Drop_Table();
}
}