Total Complexity | 2 |
Total Lines | 18 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
7 | class m190829_053119_table_article_like extends Migration |
||
8 | { |
||
9 | private $tableName = '{{%article_like}}'; |
||
10 | |||
11 | public function safeUp() |
||
12 | { |
||
13 | $this->createTable($this->tableName, [ |
||
14 | 'article_id' => $this->integer()->notNull()->comment('Article ID'), |
||
15 | 'user_id' => $this->integer()->notNull()->comment('User ID'), |
||
16 | 'create_time' => $this->createTimestamp(), |
||
17 | ], $this->tableOptions()); |
||
18 | |||
19 | $this->addPrimaryKey('article_like_pk', $this->tableName, ['article_id', 'user_id']); |
||
20 | } |
||
21 | |||
22 | public function safeDown() |
||
25 | } |
||
26 | } |
||
27 |