Blame view

console/migrations/m181101_143033_blog_category.php 791 Bytes
c237629a   Anastasia   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
24
25
26
27
28
29
  <?php
      
      use yii\db\Migration;
      
      class m181101_143033_blog_category extends Migration
      {
          public function up()
          {
              /**
               * Create table for blog's categories
               */
              $this->createTable(
                  'blog_category',
                  [
                      'id'        => $this->primaryKey(),
                      'sort'      => $this->integer(),
                      'image_id'  => $this->integer(),
                      'parent_id' => $this->integer()
                                          ->defaultValue(0),
                      'status'    => $this->boolean(),
                  ]
              );
          }
          
          public function down()
          {
              $this->dropTable('blog_category');
          }
      }