| Conditions | 1 |
| Paths | 1 |
| Total Lines | 45 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | public function safeUp() |
||
| 14 | { |
||
| 15 | $this->createMultiLanguageTable('articles', |
||
| 16 | [ |
||
| 17 | 'title' => $this->string(128)->notNull(), |
||
| 18 | 'description' => $this->text(), |
||
| 19 | 'content' => $this->text(), |
||
| 20 | 'metaKeys' => $this->string(128), |
||
| 21 | 'metaDescription' => $this->string(), |
||
| 22 | ], |
||
| 23 | [ |
||
| 24 | 'pageId' => $this->integer(), |
||
| 25 | 'active' => $this->tinyInteger()->notNull()->defaultValue(0), |
||
| 26 | 'icon' => $this->string(128), |
||
| 27 | 'alias' => $this->string(128), |
||
| 28 | ] |
||
| 29 | ); |
||
| 30 | |||
| 31 | $this->createIndex( |
||
| 32 | 'idx-articles-pageId', |
||
| 33 | 'articles', |
||
| 34 | 'pageId' |
||
| 35 | ); |
||
| 36 | |||
| 37 | $this->addForeignKey( |
||
| 38 | 'fk-articles-pageId', |
||
| 39 | 'articles', |
||
| 40 | 'pageId', |
||
| 41 | 'pages', |
||
| 42 | 'id', |
||
| 43 | 'SET NULL' |
||
| 44 | ); |
||
| 45 | |||
| 46 | $this->createIndex( |
||
| 47 | 'idx-articles-active', |
||
| 48 | 'articles', |
||
| 49 | 'active' |
||
| 50 | ); |
||
| 51 | |||
| 52 | $this->createIndex( |
||
| 53 | 'idx-articles-alias', |
||
| 54 | 'articles', |
||
| 55 | 'alias' |
||
| 56 | ); |
||
| 57 | } |
||
| 58 | |||
| 87 |