<?php

use yii\db\Migration;

/**
 * Handles the creation of table `hdr_specs`.
 */
class m170902_000003_create_sys_item_table extends Migration
{
    /**
     * 基础资料表
     */
    public function up()
    {
        $this->createTable('sys_item', [
            'id' => $this->primaryKey(),
            'name' => $this->string(32)->comment("名称"),
            'group_id' => $this->integer()->comment("所属组ID"),
            'code' => $this->string(32)->unique()->comment("代码"),
            'status' => $this->integer()->comment("状态: 0禁用, 1激活"),
            'is_sys' => $this->boolean()->defaultValue(false)->comment("系统参数: 1 是, 0 否"),
            'created_at' => $this->timestamp()->defaultValue(null),
            'updated_at' => $this->timestamp()->defaultValue(null),
        ]);
    }

    /**
     * @inheritdoc
     */
    public function down()
    {
        $this->dropTable('sys_item');
    }
}
