Blame view

console/migrations/m160413_112158_create_seo_dynamic.php 1.04 KB
fa68c38d   Administrator   12.04.16 finish ...
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
36
37
38
39
  <?php
  
  use yii\db\Migration;
  
  /**
   * Handles the creation for table `seo_dynamic`.
   */
  class m160413_112158_create_seo_dynamic extends Migration
  {
      /**
       * @inheritdoc
       */
      public function up()
      {
          $this->createTable('seo_dynamic', [
              'seo_dynamic_id' => $this->primaryKey(),
              'seo_category_id' => $this->integer(),
              'name' => $this->string(200),
              'action' => $this->string(200),
              'fields' => $this->string(),
              'title' => $this->string(),
              'h1' => $this->string(),
              'description' => $this->string(),
              'seo_text' => $this->text(),
              'status' => $this->smallInteger()
          ]);
  
          $this->addForeignKey('seo_category_seo_dynamic_fk', 'seo_dynamic', 'seo_category_id', 'seo_category', 'seo_category_id', 'CASCADE', 'CASCADE');
      }
  
      /**
       * @inheritdoc
       */
      public function down()
      {
          $this->dropForeignKey('seo_category_seo_dynamic_fk', '{{%seo_dynamic}}');
          $this->dropTable('seo_dynamic');
      }
  }