|
@ -1,39 +0,0 @@ |
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
use yii\db\Migration; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* Class m191111_081842_create_table_category |
|
|
|
|
|
*/ |
|
|
|
|
|
class m191111_081842_create_table_category extends Migration |
|
|
|
|
|
{ |
|
|
|
|
|
/** |
|
|
|
|
|
* {@inheritdoc} |
|
|
|
|
|
*/ |
|
|
|
|
|
public function up() |
|
|
|
|
|
{ |
|
|
|
|
|
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="后台商品类别表"'; |
|
|
|
|
|
$this->createTable('ats_category', [ |
|
|
|
|
|
'id' => $this->primaryKey(), |
|
|
|
|
|
'name'=>$this->string(60)->defaultValue(null)->comment('类别名称'), |
|
|
|
|
|
'pid'=>$this->integer(11)->defaultValue(null)->comment('父级id'), |
|
|
|
|
|
'goods_count'=>$this->integer(11)->defaultValue(null)->comment('商品数量'), |
|
|
|
|
|
'sort_order'=>$this->smallInteger(3)->defaultValue(null)->comment('排序'), |
|
|
|
|
|
'icon_type'=>$this->tinyInteger(1)->defaultValue(null)->comment('图标类型'), |
|
|
|
|
|
'icon'=>$this->string(64)->defaultValue(null)->comment('图标'), |
|
|
|
|
|
'is_show'=>$this->tinyInteger(1)->defaultValue(null)->comment('是否显示,1为不显示'), |
|
|
|
|
|
'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_category'); |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|