Blame view

console/migrations/m160331_132149_slider.php 802 Bytes
ba008812   Administrator   31.03.16 finish 1
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
  <?php
  
  use yii\db\Migration;
  
  class m160331_132149_slider extends Migration
  {
      public function up()
      {
          $this->createTable('{{%slider}}', [
              'slider_id' => $this->primaryKey(),
              'template_location_id' => $this->integer(4)->notNull(),
              'speed' => $this->integer(4),
              'duration' => $this->integer(4),
              'title' => $this->string(200),
              'status' => $this->smallInteger(1),
          ]);
          $this->addForeignKey('template_location_slider_fk', 'template_location', 'template_location_id', 'slider', 'template_location_id', 'CASCADE', 'CASCADE');
      }
  
      public function down()
      {
          //$this->dropForeignKey('template_location_slider_fk', '{{%template_location}}');
          $this->dropTable('{{%slider}}');
      }
  
  
  }