Blame view

console/migrations/m180402_134741_insert_into_aliases.php 1.73 KB
c237629a   Anastasia   first commit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
  <?php
  
  use yii\db\Migration;
  
  /**
   * Class m180402_134741_insert_into_aliases
   */
  class m180402_134741_insert_into_aliases extends Migration
  {
      /**
       * {@inheritdoc}
       */
      public function safeUp()
      {
          $this->batchInsert(
              'alias',
              [
                  'value',
                  'route',
                  'title',
                  'description',
                  'h1',
                  'language_id',
              ],
              [
                  [
                      'home',
                      '{"0":"site/index"}',
                      'Home page title',
                      'Home page description',
                      'Home page header',
                      1,
                  ],
                  [
                      'domashnyaya',
                      '{"0":"site/index"}',
                      'Домашняя страница',
                      'Описание домашней страницы',
                      'Заголовок домашней страницы',
                      2,
                  ],
                  [
                      'domashnya',
                      '{"0":"site/index"}',
                      'Домашня сторінка',
                      'Опис домашньої сторінки',
                      'Заголовок домашньої сторінки',
                      3,
                  ],
              ]
          );
      }
  
      /**
       * {@inheritdoc}
       */
      public function safeDown()
      {
      
      }
  
      /*
      // Use up()/down() to run migration code without a transaction.
      public function up()
      {
  
      }
  
      public function down()
      {
          echo "m180402_134741_insert_into_aliases cannot be reverted.\n";
  
          return false;
      }
      */
  }