m160208_093153_project.php 1.06 KB
<?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}}');
    }
}