-- 删除商品优惠价默认值 ALTER TABLE vgoods ALTER price DROP DEFAULT; ALTER TABLE vgoods_template ALTER price DROP DEFAULT; /*==============================================================*/ /* Table: rel_vgoods_gift */ /*==============================================================*/ create table rel_vgoods_gift ( goods_no varchar(32) not null DEFAULT '' comment '商品编号', gift_no varchar(32) not null DEFAULT '' comment '赠品编号', num int DEFAULT 1 comment '数量', created_at bigint DEFAULT 0 comment '创建时间', created_by varchar(32) comment '创建人', primary key (goods_no, gift_no) ); alter table rel_vgoods_gift comment '商品与赠品关系'; /*==============================================================*/ /* Table: vgoods */ /*==============================================================*/ alter table vgoods add column is_bind_gifts tinyint default 0 comment '是否绑定赠品:0-否,1-是'; /*==============================================================*/ /* Table: vorder */ /*==============================================================*/ alter table vorder add column parent_order_no varchar(32) default '0' comment '若为0,则为主订单,否则为父订单编号'; /*==========================表数据更新====================================*/ -- 更新活动价为0的商品模板 UPDATE vgoods_template set price=NULL where price='0' -- 更新活动价为0的商品 UPDATE vgoods set price=NULL where price='0' -- 更新订单类型 UPDATE vorder SET order_type='10', parent_order_no='0';