Browse Source

在vendor/antgoods创建ant商品模块后台商品类别表数据迁移文件,在console/migrate删除后台商品类别表数据迁移文件

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
8665f9e6ce
  1. 39
      console/migrations/m191111_081842_create_table_category.php

39
console/migrations/m191111_081842_create_table_category.php

@ -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;
}
}
Loading…
Cancel
Save