Blame view

common/modules/language/migrations/m160829_105345_add_default_languages.php 859 Bytes
4ca21c3e   Alexey Boroda   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
  <?php
  
  use yii\db\Migration;
  
  class m160829_105345_add_default_languages extends Migration
  {
      public function up()
      {
          $this->batchInsert('{{%language}}', [
              'language_id',
              'url',
              'local',
              'name',
              'default',
              'date_create',
              'date_update',
          ], [
              [
                  1,
                  'en',
                  'en-EN',
                  'English',
                  0,
                  time(),
                  time(),
              ],
              [
                  2,
                  'ru',
                  'ru-RU',
                  'Русский',
                  1,
                  time(),
                  time(),
              ],
          ]);
      }
  
      public function down()
      {
          $this->delete('{{%language}}', ['language_id' => [1, 2]]);
      }
  }