m160128_101543_fields.php 748 Bytes
<?php

use yii\db\Migration;

class m160128_101543_fields extends Migration
{
    public function up()
    {
        $tableOptions = null;

        $this->createTable('{{%fields}}', [
            'id' => $this->primaryKey(),
            'table_name' => $this->string(255)->notNull(),
            'table_id' => $this->integer(),
            'value' => $this->string(255),
            'field_name' => $this->string(),
            'field_type' => $this->string(32)->notNull(),
            'language' => $this->string(3),
            'key' => $this->integer(),
            'parent_key' => $this->integer()
        ], $tableOptions);

    }

    public function down()
    {
        $this->dropTable('{{%fields}}');
    }
}