You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
1.2 KiB

<?php
use yii\db\Migration;
/**
* Class m191111_082739_create_table_attribute
*/
class m191111_082739_create_table_attribute extends Migration
{
/**
* {@inheritdoc}
*/
public function up()
{
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="属性表"';
$this->createTable('ats_attribute', [
'id' => $this->primaryKey(),
'name'=>$this->string(50)->defaultValue(null)->comment('属性名'),
'value'=>$this->text()->comment('属性值'),
'type'=>$this->smallInteger(2)->defaultValue(null)->comment('类型'),
'sort_order'=>$this->smallInteger(3)->defaultValue(null)->comment('排序'),
'is_delete'=>$this->tinyInteger(1)->defaultValue(null)->comment('是否删除,1为已删除'),
'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'),
'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'),
],$tableOptions);
}
/**
* {@inheritdoc}
*/
public function down()
{
$this->dropTable('ats_attribute');
return true;
}
}