-- q糖兑换u豆模版表
insert into `exchange_template` (beans,sugar,seq,create_time) VALUES(10,10,1,now());
insert into `exchange_template` (beans,sugar,seq,create_time) VALUES(300,300,2,now());
insert into `exchange_template` (beans,sugar,seq,create_time) VALUES(500,500,3,now());
insert into `exchange_template` (beans,sugar,seq,create_time) VALUES(10000,10000,4,now());
insert into `exchange_template` (beans,sugar,seq,create_time) VALUES(50000,50000,5,now());
insert into `exchange_template` (beans,sugar,seq,create_time) VALUES(100000,100000,6,now());

-- 用户绑定的支付宝信息
ALTER TABLE `friendship`.`user_ali_info`
ADD UNIQUE INDEX `idx-userId`(`user_id`) USING BTREE COMMENT '用户id唯一索引';

-- 提现详情表
ALTER TABLE `friendship`.`user_account_with_draw_detail`
CHANGE COLUMN `wx_partner_trade_no` `partner_trade_no` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信/支付宝商户订单号' AFTER `club_id`,
CHANGE COLUMN `wx_payment_no` `payment_no` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信付款单号/支付宝转账订单号' AFTER `partner_trade_no`,
MODIFY COLUMN `open_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '微信openId/支付宝用户id' AFTER `user_card_id`;

ALTER TABLE `friendship`.`user_account_with_draw_detail`
ADD COLUMN `pay_fund_order_id` varchar(64) NULL COMMENT '支付资金流水号' AFTER `payment_no`;

alter table user_rate modify rate double(3,3) default 0.3 null comment '抽成比例';

alter table 'yingtao'.user_purse
	add rate double(3,3) default 0.7 null comment '用户与系统的抽成比例';


