Browse Source

在vendor/antgoods创建ant商品模块属性表数据迁移文件,在console/migrate删除属性表数据迁移文件

wechat_public_accounts
linyaostalker 5 years ago
parent
commit
f8274e4dfb
  1. 39
      vendor/antgoods/goods/src/migrations/m191119_022641_create_table_category.php
  2. 8
      vendor/antgoods/goods/src/migrations/m191119_022939_create_table_attribute.php

39
vendor/antgoods/goods/src/migrations/m191119_022641_create_table_category.php

@ -0,0 +1,39 @@
<?php
use yii\db\Migration;
/**
* Class m191119_022641_create_table_category
*/
class m191119_022641_create_table_category extends Migration
{
/**
* {@inheritdoc}
*/
public function up()
{
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="后台商品类别表"';
$this->createTable('antgoods_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('antgoods_category');
return true;
}
}

console/migrations/m191111_082739_create_table_attribute.php → vendor/antgoods/goods/src/migrations/m191119_022939_create_table_attribute.php

Loading…
Cancel
Save