Total Complexity | 2 |
Total Lines | 20 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class m190822_034841_table_article_category extends Migration |
||
8 | { |
||
9 | private $tableName = '{{%article_category}}'; |
||
10 | |||
11 | public function safeUp() |
||
12 | { |
||
13 | $this->createTable($this->tableName, [ |
||
14 | 'id' => $this->primaryKey(), |
||
15 | 'creator' => $this->integer()->notNull()->comment('Creator ID'), |
||
16 | 'name' => $this->string(32)->notNull()->comment('Name'), |
||
17 | 'create_time' => $this->createTimestamp(), |
||
18 | 'update_time' => $this->updateTimestamp(), |
||
19 | ], $this->tableOptions()); |
||
20 | |||
21 | $this->createIndex('article_category_idx_creator', $this->tableName, ['creator']); |
||
22 | } |
||
23 | |||
24 | public function safeDown() |
||
27 | } |
||
28 | } |
||
29 |