Update account id constraints to use kratos db

This commit is contained in:
Abin Simon
2022-01-10 13:18:19 +05:30
parent 21e06a0b6f
commit d2d214c7e3
4 changed files with 9 additions and 10 deletions

View File

@@ -34,7 +34,7 @@ CREATE INDEX authsrv_projectaccountresourcerole_role_id_a345b16f ON authsrv_proj
ALTER TABLE ONLY authsrv_projectaccountresourcerole
ADD CONSTRAINT authsrv_projectaccou_account_id_532ce8df_fk_authsrv_a FOREIGN KEY (account_id)
REFERENCES authsrv_account(id) DEFERRABLE INITIALLY DEFERRED;
REFERENCES identities(id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY authsrv_projectaccountresourcerole
ADD CONSTRAINT authsrv_projectaccou_organization_id_91c5602d_fk_authsrv_o FOREIGN KEY (organization_id)
@@ -50,4 +50,4 @@ ALTER TABLE ONLY authsrv_projectaccountresourcerole
ALTER TABLE ONLY authsrv_projectaccountresourcerole
ADD CONSTRAINT authsrv_projectaccou_role_id_a345b16f_fk_authsrv_r FOREIGN KEY (role_id)
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;

View File

@@ -34,7 +34,7 @@ CREATE INDEX authsrv_projectaccountnamespacerole_role_id_8a5411cc ON authsrv_pro
ALTER TABLE ONLY authsrv_projectaccountnamespacerole
ADD CONSTRAINT authsrv_projectaccou_account_id_4fac0ac2_fk_authsrv_a FOREIGN KEY (account_id)
REFERENCES authsrv_account(id) DEFERRABLE INITIALLY DEFERRED;
REFERENCES identities(id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY authsrv_projectaccountnamespacerole
ADD CONSTRAINT authsrv_projectaccou_organization_id_96c921c9_fk_authsrv_o FOREIGN KEY (organization_id)
@@ -50,4 +50,4 @@ ALTER TABLE ONLY authsrv_projectaccountnamespacerole
ALTER TABLE ONLY authsrv_projectaccountnamespacerole
ADD CONSTRAINT authsrv_projectaccou_role_id_8a5411cc_fk_authsrv_r FOREIGN KEY (role_id)
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;

View File

@@ -22,10 +22,9 @@ CREATE INDEX authsrv_groupaccount_name_d17de056 ON authsrv_groupaccount USING bt
CREATE INDEX authsrv_groupaccount_name_d17de056_like ON authsrv_groupaccount USING btree (name varchar_pattern_ops);
-- TODO: find a better constraint now that we have a different accounts table
-- ALTER TABLE ONLY authsrv_groupaccount
-- ADD CONSTRAINT authsrv_groupaccount_account_id_041e4e98_fk_authsrv_account_id FOREIGN KEY (account_id)
-- REFERENCES authsrv_account(id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY authsrv_groupaccount
ADD CONSTRAINT authsrv_groupaccount_account_id_041e4e98_fk_authsrv_account_id FOREIGN KEY (account_id)
REFERENCES identities(id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY authsrv_groupaccount
ADD CONSTRAINT authsrv_groupaccount_group_id_c67750ef_fk_authsrv_group_id FOREIGN KEY (group_id)

View File

@@ -31,7 +31,7 @@ CREATE INDEX authsrv_accountresourcerole_role_id_769ec143 ON authsrv_accountreso
ALTER TABLE ONLY authsrv_accountresourcerole
ADD CONSTRAINT authsrv_accountresou_account_id_229069ae_fk_authsrv_a FOREIGN KEY (account_id)
REFERENCES authsrv_account(id) DEFERRABLE INITIALLY DEFERRED;
REFERENCES identities(id) DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ONLY authsrv_accountresourcerole
ADD CONSTRAINT authsrv_accountresou_organization_id_22bb772c_fk_authsrv_o FOREIGN KEY (organization_id)
@@ -43,4 +43,4 @@ ALTER TABLE ONLY authsrv_accountresourcerole
ALTER TABLE ONLY authsrv_accountresourcerole
ADD CONSTRAINT authsrv_accountresou_role_id_769ec143_fk_authsrv_r FOREIGN KEY (role_id)
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;
REFERENCES authsrv_resourcerole(id) DEFERRABLE INITIALLY DEFERRED;