Total Complexity | 2 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
8 | class m180111_102503_create_media_stats_table extends Migration |
||
9 | { |
||
10 | /** |
||
11 | * @inheritdoc |
||
12 | */ |
||
13 | public function up() |
||
14 | { |
||
15 | $this->createTable('media_stats', [ |
||
16 | 'id' => $this->primaryKey(), |
||
17 | 'media_id' => $this->integer(), |
||
18 | 'likes' => $this->integer(), |
||
19 | 'comments' => $this->integer(), |
||
20 | 'account_followed_by' => $this->integer(), |
||
21 | 'account_follows' => $this->integer(), |
||
22 | 'created_at' => $this->dateTime(), |
||
23 | ]); |
||
24 | |||
25 | $this->addForeignKey('fk_media_stats_media', 'media_stats', 'media_id', 'media', 'id', 'CASCADE'); |
||
26 | } |
||
27 | |||
28 | /** |
||
29 | * @inheritdoc |
||
30 | */ |
||
31 | public function down() |
||
35 | } |
||
36 | } |
||
37 |