Total Complexity | 2 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class m200730_065801_create_category_table extends Migration |
||
9 | { |
||
10 | /** |
||
11 | * {@inheritdoc} |
||
12 | */ |
||
13 | public function safeUp() |
||
14 | { |
||
15 | $this->createTable('{{%category}}', [ |
||
16 | 'id' => $this->primaryKey(), |
||
17 | 'user_id' => $this->integer()->notNull(), |
||
18 | 'direction' => $this->tinyInteger()->notNull(), |
||
19 | 'name' => $this->string(120)->notNull(), |
||
20 | 'color' => $this->string(7)->notNull(), |
||
21 | 'icon_name' => $this->string(120)->notNull(), |
||
22 | 'status' => $this->tinyInteger()->defaultValue(1), |
||
23 | 'created_at' => $this->timestamp()->defaultValue(null), |
||
24 | 'updated_at' => $this->timestamp()->defaultValue(null), |
||
25 | ]); |
||
26 | |||
27 | $this->createIndex('category_user_id', '{{%category}}', 'user_id'); |
||
28 | } |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function safeDown() |
||
36 | } |
||
37 | } |
||
38 |