Blame view

common/modules/comment/migrations/m160726_092634_add_entity_fields.php 863 Bytes
d8c1a2e0   Yarik   Big commit artbox
1
  <?php
5c2eb7c8   Yarik   Big commit almost...
2
3
4
5
      
      use yii\db\Migration;
      
      class m160726_092634_add_entity_fields extends Migration
d8c1a2e0   Yarik   Big commit artbox
6
      {
5c2eb7c8   Yarik   Big commit almost...
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
          
          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');
          }
d8c1a2e0   Yarik   Big commit artbox
23
      }