diff --git a/mallinkAdmin/src/main/resources/db/migration/V202007311142__GROUP__ADD_002.sql b/mallinkAdmin/src/main/resources/db/migration/V202007311142__GROUP__ADD_002.sql index 9724e942a..635e2da0f 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202007311142__GROUP__ADD_002.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202007311142__GROUP__ADD_002.sql @@ -1,4 +1,4 @@ -update mall_sale_type set menus = '[1, 2, 5, 6, 8, 10, 50, 101, 102, 104, 105, 106, 108, 203, 204, 206, 207, 501, 502, 503, 504, 509, 591, 595, 601, 621, 622, 623, 624, 625, 626, 627, 901, 902]' where id=100 +update mall_sale_type set menus = '[1, 2, 5, 6, 8, 10, 50, 101, 102, 104, 105, 106, 108, 203, 204, 206, 207, 501, 502, 503, 504, 505, 506, 507, 511, 512, 522, 523, 509, 591, 595, 601, 621, 622, 623, 624, 625, 626, 627, 901, 902]' where id=100 CREATE DEFINER=`root`@`%` PROCEDURE `init_after_group`(IN tenantId VARCHAR(25),IN subTenantIds VARCHAR(250)) @@ -32,3 +32,9 @@ BEGIN COMMIT; END IF; END; + + +--两张表做手动初始化 +--wx_c_user_basic_info ---final_tenant_id +--wx_c_user_tags ---tenant_id(同final_tenant_id) +---------- diff --git a/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql b/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql index d4730c5b0..20ee18f6c 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V202007311200__FOR_MEMBER_ONLY_001.sql @@ -7,24 +7,33 @@ update `wx_c_user` set user_id = id where id in (select id from wx_c_user_basic_ ALTER TABLE `wx_c_user_basic_info` ADD COLUMN `final_tenant_id` varchar(5) NOT NULL COMMENT '归属租户ID' AFTER `parent_tenant_id`; -DROP INDEX `PHONE_UNIQUE`, -ADD UNIQUE INDEX `PHONE_UNIQUE`(`final_tenant_id`, `phone`) USING BTREE; - update wx_c_user_basic_info set final_tenant_id = parent_tenant_id; update wx_c_user_basic_info set final_tenant_id = tenant_id where (parent_tenant_id is null or trim(parent_tenant_id) = ""); +DROP INDEX `PHONE_UNIQUE`, +ADD UNIQUE INDEX `PHONE_UNIQUE`(`final_tenant_id`, `phone`) USING BTREE; + ALTER TABLE `wx_c_user_basic_info` ADD COLUMN `login_count` int(11) DEFAULT 0 COMMENT '登陆次数' AFTER `active_time`; update wx_c_user_basic_info wcubi set wcubi.login_count = (select wcu.login_count from wx_c_user wcu where wcu.id=wcubi.id); + ALTER TABLE `wx_c_user_basic_info` ADD COLUMN `avatar_url` VARCHAR(225) DEFAULT 0 COMMENT '头像地址' AFTER `nick_name`; update wx_c_user_basic_info wcubi set wcubi.avatar_url = (select wcu.avatar_url from wx_c_user wcu where wcu.id=wcubi.id); +ALTER TABLE `wx_c_user_basic_info` +MODIFY COLUMN `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '微信用户绑定的手机号' AFTER `final_tenant_id`; + +ALTER TABLE `wx_c_user_basic_info` +MODIFY COLUMN `tenant_id` varchar(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '租户ID' AFTER `id`; + + + ALTER TABLE `wx_coupon_order` ADD COLUMN `pay_vendor` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '订单渠道,EnumPayWay.class'; @@ -41,7 +50,5 @@ ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT 'app平台 1:微信 2: ALTER TABLE `wx_profit_sharing_receiver` ADD COLUMN `plat` SMALLINT(3) NOT NULL DEFAULT 1 COMMENT '平台 1:微信 2:阿里 3:头条'; -update mall_sale_type set menus = '[1, 2, 5, 6, 8, 10, 50, 101, 102, 104, 105, 106, 108, 203, 204, 206, 207, 501, 502, 503, 504, 505, 506, 507, 511, 512, 522, 523, 509, 591, 595, 601, 621, 622, 623, 624, 625, 626, 627, 901, 902]' where id=100 -