mirror of
https://github.com/iflytek/skillhub.git
synced 2026-10-09 03:17:52 +00:00
fix(db): identity_binding 外键级联删除
账号被删除时其身份绑定随之外键级联清理,配合 LdapAuthService 的孤儿绑定自愈,防止残留绑定阻塞目录身份重新建号。 Signed-off-by: jangrui <admin@jangrui.com>
This commit is contained in:
parent
d7e41ec9ff
commit
88263eba36
1 changed files with 7 additions and 0 deletions
|
|
@ -0,0 +1,7 @@
|
|||
-- identity_binding.user_id references user_account(id) without ON DELETE CASCADE. When an
|
||||
-- account is removed, its bindings would otherwise survive and block the identity from being
|
||||
-- provisioned again. Cascade the deletion so bindings never outlive their account.
|
||||
ALTER TABLE identity_binding DROP CONSTRAINT identity_binding_user_id_fkey;
|
||||
ALTER TABLE identity_binding
|
||||
ADD CONSTRAINT identity_binding_user_id_fkey
|
||||
FOREIGN KEY (user_id) REFERENCES user_account(id) ON DELETE CASCADE;
|
||||
Loading…
Add table
Reference in a new issue