m170913_082400_create_token_table   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
c 0
b 0
f 0
dl 0
loc 29
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A up() 0 15 1
A down() 0 3 1
1
<?php
2
3
use yii\db\Migration;
4
5
/**
6
 * Handles the creation of table `token`.
7
 */
8
class m170913_082400_create_token_table extends Migration
9
{
10
    /**
11
     * @inheritdoc
12
     */
13
    public function up()
14
    {
15
        $this->createTable('token', [
16
            'id' => $this->primaryKey(),
17
18
            'recipient' => $this->string()->notNull(),
19
            'token' => $this->string()->notNull(),
20
            'type' => $this->string(24)->notNull(),
21
22
            'data' => $this->json(),
23
24
            'delivery_count' => $this->integer()->unsigned()->defaultValue(0),
25
            'verify_count' => $this->integer()->unsigned()->defaultValue(0),
26
27
            'created_at' => $this->timestamp()->notNull()->defaultExpression('current_timestamp'),
28
        ]);
29
    }
30
31
    /**
32
     * @inheritdoc
33
     */
34
    public function down()
35
    {
36
        $this->dropTable('token');
37
    }
38
}
39