linyaostalker
5 years ago
21 changed files with 598 additions and 0 deletions
-
42antgoods/migrations/m191119_021851_create_table_shop_category.php
-
39antgoods/migrations/m191119_022641_create_table_category.php
-
36antgoods/migrations/m191119_022939_create_table_attribute.php
-
35antgoods/migrations/m191119_023115_create_table_goods_attr.php
-
33antgoods/migrations/m191119_024029_create_table_brand.php
-
27antgoods/migrations/m191119_024205_create_table_goods.php
-
27antgoods/migrations/m191119_024345_create_table_goods_sku.php
-
36antgoods/migrations/m191119_025607_create_table_supplier.php
-
35antgoods/migrations/m191119_025843_create_table_filter_attr.php
-
22antgoods/migrations/m191125_012449_update_column_icon_type_in_antgoods_category.php
-
20antgoods/migrations/m191125_083820_drop_column_icon_type_in_table_antgoods_category.php
-
26antgoods/migrations/m191125_084547_update_column_pid_and_icon_in_table_antgoods_category.php
-
20antgoods/migrations/m191125_104137_drop_column_icon_type_in_table_antgoods_shop_category.php
-
26antgoods/migrations/m191125_104510_update_column_pid_and_icon_in_table_antgoods_shop_category.php
-
20antgoods/migrations/m191127_114228_add_column_is_manaul_in_table_antgoods_goods_sku.php
-
20antgoods/migrations/m191129_010349_add_column_sku_mode_in_antgoods_goods.php
-
26antgoods/migrations/m191129_020131_add_columns_goods_id_and_attr_id_in_table_antgoods_goods_attr.php
-
20antgoods/migrations/m191130_004933_add_column_cat_id_in_table_antgoods_attribute.php
-
27antgoods/migrations/m191202_082041_drop_columns_in_table_antgoods_goods_sku.php
-
37antgoods/migrations/sql/goods.sql
-
24antgoods/migrations/sql/goods_sku.sql
@ -0,0 +1,42 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191119_021851_create_table_shop_category |
|||
*/ |
|||
class m191119_021851_create_table_shop_category extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="前端商品类别表"'; |
|||
$this->createTable('antgoods_shop_category', [ |
|||
'id' => $this->primaryKey(), |
|||
'name'=>$this->string(60)->notNull()->comment('类别名称'), |
|||
'pid'=>$this->integer(11)->defaultValue(null)->comment('父级id'), |
|||
'goods_count'=>$this->integer(11)->defaultValue(0)->comment('商品数量'), |
|||
'keywords'=>$this->string(100)->defaultValue(null)->comment('关键字'), |
|||
'desc'=>$this->string(255)->defaultValue(null)->comment('描述'), |
|||
'sort_order'=>$this->smallInteger(3)->defaultValue(0)->comment('排序'), |
|||
'icon_type'=>$this->tinyInteger(1)->defaultValue(null)->comment('图标类型'), |
|||
'icon'=>$this->string(64)->defaultValue(null)->comment('图标'), |
|||
'filter_attr'=>$this->text()->comment('筛选属性'), |
|||
'is_show'=>$this->tinyInteger(1)->defaultValue(0)->comment('是否显示,1为不显示'), |
|||
'is_delete'=>$this->tinyInteger(1)->defaultValue(0)->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_shop_category'); |
|||
return true; |
|||
} |
|||
} |
@ -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)->notNull()->comment('类别名称'), |
|||
'pid'=>$this->integer(11)->defaultValue(null)->comment('父级id'), |
|||
'goods_count'=>$this->integer(11)->defaultValue(0)->comment('商品数量'), |
|||
'sort_order'=>$this->smallInteger(3)->defaultValue(0)->comment('排序'), |
|||
'icon_type'=>$this->tinyInteger(1)->defaultValue(null)->comment('图标类型'), |
|||
'icon'=>$this->string(64)->defaultValue(null)->comment('图标'), |
|||
'is_show'=>$this->tinyInteger(1)->defaultValue(0)->comment('是否显示,1为不显示'), |
|||
'is_delete'=>$this->tinyInteger(1)->defaultValue(0)->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; |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191119_022939_create_table_attribute |
|||
*/ |
|||
class m191119_022939_create_table_attribute extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="属性表"'; |
|||
$this->createTable('antgoods_attribute', [ |
|||
'id' => $this->primaryKey(), |
|||
'name'=>$this->string(50)->notNull()->comment('属性名'), |
|||
'value'=>$this->text()->notNull()->comment('属性值'), |
|||
'type'=>$this->smallInteger(2)->defaultValue(null)->comment('类型'), |
|||
'sort_order'=>$this->smallInteger(3)->defaultValue(null)->comment('排序'), |
|||
'is_delete'=>$this->tinyInteger(1)->defaultValue(0)->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_attribute'); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191119_023115_create_table_goods_attr |
|||
*/ |
|||
class m191119_023115_create_table_goods_attr extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="商品属性表"'; |
|||
$this->createTable('antgoods_goods_attr', [ |
|||
'id' => $this->primaryKey(), |
|||
'goods_id'=>$this->integer(11)->notNull()->comment('商品id'), |
|||
'attr_id'=>$this->integer(11)->notNull()->comment('属性id'), |
|||
'attr_value'=>$this->string(50)->notNull()->comment('属性名'), |
|||
'is_delete'=>$this->tinyInteger(1)->defaultValue(0)->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_goods_attr'); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191119_024029_create_table_brand |
|||
*/ |
|||
class m191119_024029_create_table_brand extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="品牌表"'; |
|||
$this->createTable('antgoods_brand', [ |
|||
'id' => $this->primaryKey(), |
|||
'name'=>$this->string(50)->notNull()->comment('品牌名'), |
|||
'is_delete'=>$this->tinyInteger(1)->defaultValue(0)->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_brand'); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191119_024205_create_table_goods |
|||
*/ |
|||
class m191119_024205_create_table_goods extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$sql = file_get_contents(__DIR__."/sql/goods.sql"); |
|||
$this->execute($sql); |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function down() |
|||
{ |
|||
$this->dropTable("antgoods_goods"); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191119_024345_create_table_goods_sku |
|||
*/ |
|||
class m191119_024345_create_table_goods_sku extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$sql = file_get_contents(__DIR__."/sql/goods_sku.sql"); |
|||
$this->execute($sql); |
|||
} |
|||
|
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function down() |
|||
{ |
|||
$this->dropTable("antgoods_goods_sku"); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,36 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191119_025607_create_table_supplier |
|||
*/ |
|||
class m191119_025607_create_table_supplier extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="供应商表"'; |
|||
$this->createTable('antgoods_supplier', [ |
|||
'id' => $this->primaryKey(), |
|||
'name'=>$this->string(50)->notNull()->comment('供应商名称'), |
|||
'full_name'=>$this->string(50)->notNull()->comment('供应商全称'), |
|||
'phone'=>$this->string(20)->notNull()->comment('手机号码'), |
|||
'address'=>$this->string(50)->notNull()->comment('地址'), |
|||
'is_delete'=>$this->tinyInteger(1)->defaultValue(0)->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_supplier'); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,35 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191119_025843_create_table_filter_attr |
|||
*/ |
|||
class m191119_025843_create_table_filter_attr extends Migration |
|||
{ |
|||
/** |
|||
* {@inheritdoc} |
|||
*/ |
|||
public function up() |
|||
{ |
|||
$tableOptions = 'CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE=InnoDB COMMENT="筛选属性表"'; |
|||
$this->createTable('antgoods_filter_attr', [ |
|||
'id' => $this->primaryKey(), |
|||
'goods_id'=>$this->integer(11)->notNull()->comment('商品id'), |
|||
'attr_id'=>$this->integer(11)->notNull()->comment('属性id'), |
|||
'attr_value'=>$this->string(50)->notNull()->comment('属性值'), |
|||
'is_delete'=>$this->tinyInteger(1)->defaultValue(0)->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_filter_attr'); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,22 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191125_012449_update_column_icon_type_in_antgoods_category |
|||
*/ |
|||
class m191125_012449_update_column_icon_type_in_antgoods_category extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->dropColumn('antgoods_category', 'icon_type'); |
|||
$this->addColumn('antgoods_category', 'icon_type', $this->tinyInteger(1)->defaultValue(1)->comment('图标类型')); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->dropColumn('antgoods_category', 'icon_type'); |
|||
$this->addColumn('antgoods_category', 'icon_type', $this->tinyInteger(1)->defaultValue(null)->comment('图标类型')); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191125_083820_drop_column_icon_type_in_table_antgoods_category |
|||
*/ |
|||
class m191125_083820_drop_column_icon_type_in_table_antgoods_category extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->dropColumn('antgoods_category', 'icon_type'); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->addColumn('antgoods_category', 'icon_type', $this->tinyInteger(1)->defaultValue(null)->comment('图标类型')); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191125_084547_update_column_pid_and_icon_in_table_antgoods_category |
|||
*/ |
|||
class m191125_084547_update_column_pid_and_icon_in_table_antgoods_category extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->dropColumn('antgoods_category', 'icon'); |
|||
$this->addColumn('antgoods_category', 'icon', $this->integer(11)->defaultValue(null)->comment('图标')); |
|||
$this->dropColumn('antgoods_category', 'pid'); |
|||
$this->addColumn('antgoods_category', 'pid', $this->integer(11)->defaultValue(0)->comment('父级id')); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->dropColumn('antgoods_category', 'icon'); |
|||
$this->addColumn('antgoods_category', 'icon', $this->string(64)->defaultValue(null)->comment('图标')); |
|||
$this->dropColumn('antgoods_category', 'pid'); |
|||
$this->addColumn('antgoods_category', 'pid', $this->integer(11)->defaultValue(null)->comment('父级id')); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191125_104137_drop_column_icon_type_in_table_antgoods_shop_category |
|||
*/ |
|||
class m191125_104137_drop_column_icon_type_in_table_antgoods_shop_category extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->dropColumn('antgoods_shop_category', 'icon_type'); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->addColumn('antgoods_shop_category', 'icon_type', $this->tinyInteger(1)->defaultValue(null)->comment('图标类型')); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191125_104510_update_column_pid_and_icon_in_table_antgoods_shop_category |
|||
*/ |
|||
class m191125_104510_update_column_pid_and_icon_in_table_antgoods_shop_category extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->dropColumn('antgoods_shop_category', 'icon'); |
|||
$this->addColumn('antgoods_shop_category', 'icon', $this->integer(11)->defaultValue(null)->comment('图标')); |
|||
$this->dropColumn('antgoods_shop_category', 'pid'); |
|||
$this->addColumn('antgoods_shop_category', 'pid', $this->integer(11)->defaultValue(0)->comment('父级id')); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->dropColumn('antgoods_shop_category', 'icon'); |
|||
$this->addColumn('antgoods_shop_category', 'icon', $this->string(64)->defaultValue(null)->comment('图标')); |
|||
$this->dropColumn('antgoods_shop_category', 'pid'); |
|||
$this->addColumn('antgoods_shop_category', 'pid', $this->integer(11)->defaultValue(null)->comment('父级id')); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191127_114228_add_column_is_manaul_in_table_antgoods_goods_sku |
|||
*/ |
|||
class m191127_114228_add_column_is_manaul_in_table_antgoods_goods_sku extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->addColumn('antgoods_goods_sku', 'is_manaul', $this->tinyInteger(1)->notNull()->defaultValue(0)->comment('是否手动')); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->dropColumn('antgoods_goods_sku', 'is_manaul'); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191129_010349_add_column_sku_mode_in_antgoods_goods |
|||
*/ |
|||
class m191129_010349_add_column_sku_mode_in_antgoods_goods extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->addColumn('antgoods_goods', 'sku_mode', $this->tinyInteger(1)->notNull()->defaultValue(1)->comment('sku类型')); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->dropColumn('antgoods_goods', 'sku_mode'); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191129_020131_add_columns_goods_id_and_attr_id_in_table_antgoods_goods_attr |
|||
*/ |
|||
class m191129_020131_add_columns_goods_id_and_attr_id_in_table_antgoods_goods_attr extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->dropColumn('antgoods_goods_attr', 'goods_id'); |
|||
$this->dropColumn('antgoods_goods_attr', 'attr_id'); |
|||
$this->addColumn('antgoods_goods_attr', 'goods_id', $this->integer(11)->notNull()->defaultValue(0)->comment('商品id')); |
|||
$this->addColumn('antgoods_goods_attr', 'attr_id', $this->integer(11)->notNull()->defaultValue(0)->comment('属性id')); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->dropColumn('antgoods_goods_attr', 'goods_id'); |
|||
$this->dropColumn('antgoods_goods_attr', 'attr_id'); |
|||
$this->addColumn('antgoods_goods_attr', 'goods_id', $this->integer(11)->notNull()->comment('商品id')); |
|||
$this->addColumn('antgoods_goods_attr', 'attr_id', $this->integer(11)->notNull()->comment('属性id')); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,20 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191130_004933_add_column_cat_id_in_table_antgoods_attribute |
|||
*/ |
|||
class m191130_004933_add_column_cat_id_in_table_antgoods_attribute extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->addColumn('antgoods_attribute', 'cat_id', $this->integer(11)->notNull()->defaultValue(0)->comment('后台商品分类id')); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->dropColumn('antgoods_attribute', 'cat_id'); |
|||
return true; |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
<?php |
|||
|
|||
use yii\db\Migration; |
|||
|
|||
/** |
|||
* Class m191202_082041_drop_columns_in_table_antgoods_goods_sku |
|||
*/ |
|||
class m191202_082041_drop_columns_in_table_antgoods_goods_sku extends Migration |
|||
{ |
|||
public function up() |
|||
{ |
|||
$this->dropColumn('antgoods_goods_sku', 'weight'); |
|||
$this->dropColumn('antgoods_goods_sku', 'length'); |
|||
$this->dropColumn('antgoods_goods_sku', 'width'); |
|||
$this->dropColumn('antgoods_goods_sku', 'height'); |
|||
$this->dropColumn('antgoods_goods_sku', 'diameter'); |
|||
} |
|||
|
|||
public function down() |
|||
{ |
|||
$this->addColumn('antgoods_goods_sku', 'weight', $this->integer(8)->defaultValue(null)->comment('重量')); |
|||
$this->addColumn('antgoods_goods_sku', 'length', $this->integer(8)->defaultValue(null)->comment('长度')); |
|||
$this->addColumn('antgoods_goods_sku', 'width', $this->integer(8)->defaultValue(null)->comment('宽度')); |
|||
$this->addColumn('antgoods_goods_sku', 'height', $this->integer(8)->defaultValue(null)->comment('高度')); |
|||
$this->addColumn('antgoods_goods_sku', 'diameter', $this->integer(8)->defaultValue(null)->comment('直径')); |
|||
} |
|||
} |
@ -0,0 +1,37 @@ |
|||
DROP TABLE IF EXISTS `antgoods_goods`; |
|||
CREATE TABLE `antgoods_goods` ( |
|||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|||
`pid` int(11) DEFAULT NULL COMMENT '父级id', |
|||
`cat_id` int(11) NOT NULL COMMENT '后台商品类别id', |
|||
`brand_id` int(11) NOT NULL COMMENT '品牌id', |
|||
`shop_cat_id` int(11) NOT NULL COMMENT '前端商品类别id', |
|||
`name` varchar(120) NOT NULL COMMENT '商品名称', |
|||
`sn` varchar(60) DEFAULT NULL COMMENT '商品唯一货号', |
|||
`code` varchar(50) DEFAULT NULL COMMENT '商品货码', |
|||
`supplier_id` int(11) DEFAULT NULL COMMENT '供应商id', |
|||
`weight` mediumint(8) DEFAULT NULL unique COMMENT '重量', |
|||
`length` mediumint(8) DEFAULT NULL unique COMMENT '长度', |
|||
`width` mediumint(8) DEFAULT NULL unique COMMENT '宽度', |
|||
`height` mediumint(8) DEFAULT NULL unique COMMENT '高度', |
|||
`diameter` mediumint(8) DEFAULT NULL unique COMMENT '直径', |
|||
`unit` varchar(16) DEFAULT NULL COMMENT '单位', |
|||
`sold_count` int(10) DEFAULT NULL unique COMMENT '已售数量', |
|||
`limit_count` int(10) DEFAULT NULL COMMENT '限购数量', |
|||
`stock` int(10) DEFAULT NULL COMMENT '库存', |
|||
`stock_warn` int(10) DEFAULT NULL COMMENT '库存警告', |
|||
`market_price` int(20) DEFAULT NULL unique COMMENT '市场价', |
|||
`price` int(20) DEFAULT NULL unique COMMENT '销售价', |
|||
`brief` varchar(255) DEFAULT NULL COMMENT '简介', |
|||
`description` text COMMENT '详细介绍', |
|||
`image` int(11) DEFAULT NULL COMMENT '图片id', |
|||
`model_id` int(11) DEFAULT NULL COMMENT '模型id', |
|||
`is_sale` tinyint(1) DEFAULT '0' COMMENT '该商品是否开放销售,1为是,0为否', |
|||
`sort_order` smallint(3) DEFAULT NULL COMMENT '排序', |
|||
`bouns_points` mediumint(8) DEFAULT NULL COMMENT '奖励积分', |
|||
`experience_points` mediumint(8) DEFAULT NULL COMMENT '经验值', |
|||
`is_delete` tinyint(1) DEFAULT '0' COMMENT '是否删除,1为已删除', |
|||
`express_template` int(11) DEFAULT NULL COMMENT '配送详情id', |
|||
`created_at` int(10) DEFAULT '0' COMMENT '创建时间', |
|||
`updated_at` int(10) DEFAULT '0' COMMENT '更新时间', |
|||
PRIMARY KEY (`id`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品表'; |
@ -0,0 +1,24 @@ |
|||
DROP TABLE IF EXISTS `antgoods_goods_sku`; |
|||
CREATE TABLE `antgoods_goods_sku` ( |
|||
`id` int(11) NOT NULL AUTO_INCREMENT, |
|||
`goods_id` int(11) NOT NULL COMMENT '商品id', |
|||
`goods_code` varchar(50) DEFAULT NULL COMMENT '商品条码', |
|||
`goods_sn` varchar(60) NOT NULL COMMENT '商品唯一货号', |
|||
`goods_attr` varchar(60) DEFAULT NULL COMMENT '属性匹配', |
|||
`weight` mediumint(8) DEFAULT NULL COMMENT '重量', |
|||
`length` mediumint(8) DEFAULT NULL COMMENT '长度', |
|||
`width` mediumint(8) DEFAULT NULL COMMENT '宽度', |
|||
`height` mediumint(8) DEFAULT NULL COMMENT '高度', |
|||
`diameter` mediumint(8) DEFAULT NULL COMMENT '直径', |
|||
`sold_count` int(10) DEFAULT NULL COMMENT '已售数量', |
|||
`stock` int(10) DEFAULT NULL COMMENT '库存', |
|||
`market_price` int(20) DEFAULT NULL COMMENT '市场价', |
|||
`price` int(20) DEFAULT NULL COMMENT '销售价', |
|||
`model_id` int(11) DEFAULT NULL COMMENT '模型id', |
|||
`is_sale` tinyint(1) DEFAULT '0' COMMENT '该商品是否开放销售,1为是,0为否', |
|||
`sort_order` smallint(3) DEFAULT '0' COMMENT '排序', |
|||
`is_delete` tinyint(1) DEFAULT '0' COMMENT '是否删除,1为已删除', |
|||
`created_at` int(10) DEFAULT '0' COMMENT '创建时间', |
|||
`updated_at` int(10) DEFAULT '0' COMMENT '更新时间', |
|||
PRIMARY KEY (`id`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品sku表'; |
Write
Preview
Loading…
Cancel
Save
Reference in new issue