Blame view

console/migrations/m160208_093153_project.php 1.09 KB
14a09168   Alex Savenko   init 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
30
31
32
33
34
35
36
  <?php

  

  use yii\db\Migration;

  

  class m160208_093153_project extends Migration

  {

      public function up()

      {

          $tableOptions = null;

  

          $this->createTable('{{%project}}', [

              'project_id' => $this->primaryKey(),

              'user_id' =>  $this->integer()->notNull(),

              'name' => $this->string(255)->notNull(),

              'link' => $this->string(255),

              'project_pid' => $this->integer(),

              'date_add' => $this->timestamp()->notNull(),

              'date_end' => $this->timestamp(),

              'user_add_id' => $this->integer(),

              'view_count' => $this->float(),

              'budget' =>  $this->string(255),

              'city' =>  $this->string(255),

              'street' =>  $this->string(255),

              'house' =>  $this->string(255),

              'payment_variant' =>  $this->smallInteger()->defaultValue(1),

              'deadline' =>  $this->integer(),

              'description' =>  $this->text(),

          ], $tableOptions);

  

      }

  

      public function down()

      {

          $this->dropTable('{{%project}}');

      }

  }