Blame view

console/migrations/m160811_143339_delete_blog_column.php 764 Bytes
8fef08bc   Yarik   Structure data fi...
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
  <?php
  
  use yii\db\Migration;
  
  class m160811_143339_delete_blog_column extends Migration
  {
      public function up()
      {
          $this->dropTable('{{%blog}}');
      }
  
      public function down()
      {
          $tableOptions = null;
      
          $this->createTable('{{%blog}}', [
              'blog_id' => $this->primaryKey(),
              'user_id' =>  $this->integer()->notNull(),
              'name' => $this->string(255)->notNull(),
              'link' => $this->string(255),
              'date_add' => $this->timestamp()->notNull(),
              'user_add_id' => $this->integer(),
              'view_count' => $this->integer()->defaultValue(0),
              'description' =>  $this->text(),
              'cover' =>  $this->string(255),
          ], $tableOptions);
      }
  }