标题: 度量快速开发平台:解决注册ID一样的问题 [打印本页] 作者: caixuqad 时间: 2020-5-7 17:04 标题: 度量快速开发平台:解决注册ID一样的问题 解决注册人员时,ID值一样的问题
delete from address_book where userid not in (select id from sa_staff_info);
delete from sa_staff_role where user_id not in (select id from sa_staff_info);
delete from sa_staff_role where dept_id not in (select dept_id from sa_dept_dict);
alter table SA_STAFF_INFO add constraint PK_SA_STAFF_INFO_ID unique(ID);
alter table ADDRESS_BOOK add constraint FK_address_book_uid foreign key(USERID) references sa_staff_info(ID) on delete cascade;
alter table SA_STAFF_ROLE add constraint FK_STAFF_UID foreign key(USER_ID) references sa_staff_info(ID) on delete cascade;