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