Blame view

console/migrations/m160930_151832_create_tax_option_lang_table.php 1.66 KB
d55d2fe0   Yarik   Multilanguage
1
  <?php
d55d2fe0   Yarik   Multilanguage
2
      
c70f24ea   Yarik   For Leha commit.
3
4
      use yii\db\Migration;
      
d55d2fe0   Yarik   Multilanguage
5
      /**
c70f24ea   Yarik   For Leha commit.
6
       * Handles the creation for table `tax_option_lang`.
d55d2fe0   Yarik   Multilanguage
7
       */
c70f24ea   Yarik   For Leha commit.
8
      class m160930_151832_create_tax_option_lang_table extends Migration
d55d2fe0   Yarik   Multilanguage
9
      {
c70f24ea   Yarik   For Leha commit.
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
          /**
           * @inheritdoc
           */
          public function up()
          {
              $this->createTable(
                  'tax_option_lang',
                  [
                      'tax_option_id' => $this->integer()
                                              ->notNull(),
                      'language_id'   => $this->integer()
                                              ->notNull(),
                      'value'         => $this->string()
                                              ->notNull(),
                  ]
              );
              $this->createIndex(
                  'tax_option_lang_tax_option_language_key',
                  'tax_option_lang',
                  [
                      'tax_option_id',
                      'language_id',
                  ],
                  true
              );
              
              $this->addForeignKey(
                  'tax_option_fk',
                  'tax_option_lang',
                  'tax_option_id',
                  'tax_option',
                  'id',
                  'CASCADE',
                  'CASCADE'
              );
              $this->addForeignKey(
                  'language_fk',
                  'tax_option_lang',
                  'language_id',
                  'language',
                  'id',
                  'RESTRICT',
                  'CASCADE'
              );
          }
          
          /**
           * @inheritdoc
           */
          public function down()
          {
              $this->dropTable('tax_option_lang');
          }
d55d2fe0   Yarik   Multilanguage
63
      }