cashier_server/sqls/250403/tb_shop_user.sql

13 lines
794 B
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- ----------------------------
-- tb_shop_user表扩展字段
-- ----------------------------
ALTER TABLE `tb_shop_user`
ADD COLUMN `is_merged_to_head` tinyint NULL DEFAULT 0 COMMENT '是否已经合并数据到主店 1-是 0-否 默认0',
ADD COLUMN `merged_users` text NULL COMMENT '已经合并过来的用户信息jsonArray格式,[{\"id\":1,\"shopId\":2,...},{\"id\":1,\"shopId\":2,...}]',
ADD COLUMN `all_shop_ids` varchar(1200) NULL COMMENT '适用门店id集合逗号分隔例如0,1,2,3,...查询的时候 all_shop_ids like \'%,1,%\';';
-- ----------------------------
-- 处理历史数据
-- ----------------------------
update tb_shop_user set is_merged_to_head = 0;
update tb_shop_user set all_shop_ids = concat('0,', shop_id, ',');