|
|
|
@@ -9,9 +9,9 @@ insert into wx_c_user_basic_info_20200826 select * from wx_c_user_basic_info; |
|
|
|
ALTER TABLE `wx_c_user_basic_info` |
|
|
|
ADD COLUMN `final_tenant_id` varchar(5) NOT NULL COMMENT '归属租户ID' AFTER `parent_tenant_id`; |
|
|
|
|
|
|
|
update wx_c_user_basic_info set final_tenant_id = parent_tenant_id; |
|
|
|
update wx_c_user_basic_info set final_tenant_id = parent_tenant_id where parent_tenant_id is not null and trim(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) = ""); |
|
|
|
|
|
|
|
-----注意重复数据--注意重复数据 |
|
|
|
ALTER TABLE wx_c_user_basic_info ADD UNIQUE INDEX `PHONE_UNIQUE`(`final_tenant_id`, `phone`) USING BTREE; |
|
|
|
|
|
|
|
|
|
|
|
|