Blame view

migrations/m160726_092634_add_entity_fields.php 863 Bytes
a2cde075   Yarik   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
  <?php
      
      use yii\db\Migration;
      
      class m160726_092634_add_entity_fields extends Migration
      {
          
          public function up()
          {
              $this->addColumn('{{%artbox_comment}}', 'entity', $this->string()
                                                                     ->notNull()
                                                                     ->defaultValue(''));
              $this->addColumn('{{%artbox_comment}}', 'entity_id', $this->integer()
                                                                        ->notNull()
                                                                        ->defaultValue(1));
          }
          
          public function down()
          {
              $this->dropColumn('{{%artbox_comment}}', 'entity');
              $this->dropColumn('{{%artbox_comment}}', 'entity_id');
          }
      }