Total Complexity | 2 |
Total Lines | 32 |
Duplicated Lines | 0 % |
Changes | 3 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
7 | class m190822_070404_data_article extends Migration |
||
8 | { |
||
9 | private $tableName = '{{%article}}'; |
||
10 | |||
11 | private $metaTableName = '{{%article_meta}}'; |
||
12 | |||
13 | public function safeUp() |
||
14 | { |
||
15 | $now = time(); |
||
16 | $this->insert($this->tableName, [ |
||
17 | 'id' => 1, |
||
18 | 'title' => 'Hello World', |
||
19 | 'creator' => 1, |
||
20 | 'author' => 'Administrator', |
||
21 | 'category_id' => 1, |
||
22 | 'summary' => 'Congratulation! You have set up Yii2 and Vue application successfully.', |
||
23 | 'cover' => '', |
||
24 | 'release_time' => $now, |
||
25 | 'create_time' => $now, |
||
26 | 'update_time' => $now, |
||
27 | ]); |
||
28 | |||
29 | $this->insert($this->metaTableName, [ |
||
30 | 'article_id' => 1, |
||
31 | 'content' => '<p><strong>Congratulation!</strong> You have set up Yii2 and Vue application successfully.</p>', |
||
32 | ]); |
||
33 | } |
||
34 | |||
35 | public function safeDown() |
||
39 | } |
||
40 | } |
||
41 |