Blame view

migrations/order-to-comment/m170525_095043_order_to_comment.php 926 Bytes
faff2c48   Yarik   Artbox comment cr...
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
  <?php
      
      use yii\db\Migration;
      
      class m170525_095043_order_to_comment extends Migration
      {
          public function safeUp()
          {
              $this->addForeignKey(
                  'customer_id_customer',
                  '{{%artbox_comment}}',
                  'customer_id',
                  'customer',
                  'id',
                  'CASCADE',
                  'CASCADE'
              );
              
              $this->addForeignKey(
                  'customer_id_customer',
                  '{{%artbox_like}}',
                  'customer_id',
                  'customer',
                  'id',
                  'CASCADE',
                  'CASCADE'
              );
          }
          
          public function safeDown()
          {
              $this->dropForeignKey('customer_id_customer', '{{%artbox_comment}}');
              $this->dropForeignKey('customer_id_customer', '{{%artbox_like}}');
          }
      }