Commit c2b2d351 by 张富康

feat(db): 添加富康商品相关字段及新表支持扩展

- 在dj_car_life_goods_info表新增配件性质字段
- 修改dj_car_life_upgrade_goods表结构,增加质保时间及第三方信息字段
- 新建dj_car_life_goods_operation_log表,记录产品操作历史
- 新建dj_car_life_merchant_goods_inventory_type_ref表,映射商品库存类型与商户关系
- 在dj_car_life_merchant_goods_stock_reduce_record表新增库存模式字段
- 各新表统一使用utf8mb4字符集及排序规则
1 parent 7bdc49dd
......@@ -11,6 +11,60 @@ alter table nb_cb_batch_transfer
### 彦峰 -----------------end---------------------
### 富康 -----------------start-------------------
alter table dj_car_life_goods_info
add column accessory_type tinyint(1) null comment '配件性质:1-原厂件 2-品牌件';
alter table dj_car_life_upgrade_goods
modify column warranty_period decimal(5, 2) null comment '质保时间/年',
add column third_party_name varchar(100) null comment '第三方名称',
add column price_unit_type tinyint(1) null comment '计价单位类型 1-把、2-本、3-对、4-个、5-根、6-盒、7-件、8-卷、9-块、10-辆、11-米、12-克、13-升、14-双、15-台、16-套、17-条、18-桶、19-位、20-页、21-张',
add column price_unit_name varchar(100) null comment '计价单位名称',
add column purchase_cost decimal(12, 2) null comment '采购成本/元',
add column operation_coefficient decimal(12, 2) null comment '运营系数',
add column operation_cost decimal(12, 2) null comment '运营成本',
add column applicable_area varchar(100) null comment '适用区域';
create table dj_car_life_goods_operation_log
(
id int auto_increment comment '主键ID' primary key,
opr_type tinyint not null comment '操作方式(1-删除、2-新增、3-修改)',
old_value mediumtext null comment '旧值 json格式',
new_value mediumtext null comment '新值 json格式',
base_goods_id int not null comment '商品基础id',
commodity_code varchar(32) not null comment '商品id编码',
type varchar(50) null comment '商品编码',
goods_type tinyint not null comment '1-商品信息, 2-升级商品',
updated_user varchar(64) not null comment '操作人',
created_by varchar(64) not null comment '创建人',
created_date datetime default current_timestamp not null comment '创建时间',
updated_by varchar(64) not null comment '修改人',
updated_date datetime default current_timestamp not null on update current_timestamp comment '修改时间',
deleted_flag char default 'N' not null comment '删除标识(D:已删除;N:未删除)',
index idx_base_goods_id (base_goods_id)
) comment '产品操作记录表' charset = utf8mb4
collate utf8mb4_unicode_ci;
create table `dj_car_life_merchant_goods_inventory_type_ref`
(
id int auto_increment comment '主键ID' primary key,
merchant_goods_id int null comment '商户商品ID',
package_code varchar(32) null comment '套餐编码',
inventory_type tinyint(1) null comment '库存模式 1-虚拟、2-实物',
merchant_id int null comment '商户ID',
created_by varchar(64) default 'system' not null comment '创建人',
created_date datetime default current_timestamp not null comment '创建时间',
updated_by varchar(64) default 'system' not null comment '修改人',
updated_date datetime default current_timestamp not null on update current_timestamp comment '修改时间',
deleted_flag char default 'N' not null comment '删除标识(D:已删除;N:未删除)',
INDEX idx_goods_type_del (merchant_goods_id, deleted_flag, inventory_type),
INDEX idx_package_type_del (package_code, deleted_flag, inventory_type),
INDEX idx_union (merchant_goods_id, package_code, inventory_type, merchant_id)
) comment '商品上架库存类型映射表' charset = utf8mb4
collate utf8mb4_unicode_ci;
alter table dj_car_life_merchant_goods_stock_reduce_record
add column inventory_type tinyint(1) null default 2 comment '库存模式 1-虚拟、2-实物';
### 富康 -----------------end---------------------
### 璐琦 -----------------start-------------------
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!