| Total Complexity | 2 |
| Total Lines | 30 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class m180111_102457_create_media_table extends Migration |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @inheritdoc |
||
| 12 | */ |
||
| 13 | public function up() |
||
| 14 | { |
||
| 15 | $this->createTable('media', [ |
||
| 16 | 'id' => $this->primaryKey(), |
||
| 17 | 'account_id' => $this->integer(), |
||
| 18 | 'shortcode' => $this->string()->notNull()->unique(), |
||
| 19 | 'is_video' => $this->boolean(), |
||
| 20 | 'caption' => $this->text(), |
||
| 21 | 'instagram_id' => $this->string(), |
||
| 22 | 'taken_at' => $this->dateTime(), |
||
| 23 | 'updated_at' => $this->dateTime(), |
||
| 24 | 'created_at' => $this->dateTime(), |
||
| 25 | 'monitoring' => $this->boolean()->notNull()->defaultValue(0), |
||
| 26 | ]); |
||
| 27 | |||
| 28 | $this->addForeignKey('fk_media_account', 'media', 'account_id', 'account', 'id', 'CASCADE'); |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * @inheritdoc |
||
| 33 | */ |
||
| 34 | public function down() |
||
| 38 | } |
||
| 39 | } |
||
| 40 |