Completed
Push — master ( 70482c...d02777 )
by Alexey
01:54
created

m130524_201442_init::down()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
namespace yiicod_auth_migrations;
3
4
use yii\db\Migration;
5
use yii\db\Schema;
6
7
class m130524_201442_init extends Migration
8
{
9
    public function up()
10
    {
11
        $tableOptions = null;
12
        if ($this->db->driverName === 'mysql') {
13
            $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB';
14
        }
15
16
        $this->createTable('{{%user}}', [
17
            'id' => Schema::TYPE_PK,
18
            'username' => Schema::TYPE_STRING . ' NOT NULL',
19
            'email' => Schema::TYPE_STRING . ' NOT NULL',
20
            'auth_Key' => Schema::TYPE_STRING . '(32) NOT NULL',
21
            'password_hash' => Schema::TYPE_STRING . ' NOT NULL',
22
            'password_reset_token' => Schema::TYPE_STRING,
23
            'status' => Schema::TYPE_SMALLINT . ' NOT NULL',
24
            'created_date' => Schema::TYPE_DATETIME . ' NOT NULL',
25
            'updated_date' => Schema::TYPE_DATETIME . ' NOT NULL',
26
        ], $tableOptions);
27
    }
28
29
    public function down()
30
    {
31
        $this->dropTable('{{%user}}');
32
    }
33
}
34