-- Migration from 132 to 133

ALTER TABLE ROLE_ASSIGNMENTS DROP CONSTRAINT ROAS_DBIN_FK;
ALTER TABLE ROLE_ASSIGNMENTS DROP CONSTRAINT ROAS_SPACE_FK;
ALTER TABLE ROLE_ASSIGNMENTS DROP CONSTRAINT ROAS_PERS_FK_GRANTEE;
ALTER TABLE ROLE_ASSIGNMENTS DROP CONSTRAINT ROAS_AG_FK_GRANTEE;

ALTER TABLE ROLE_ASSIGNMENTS ADD CONSTRAINT ROAS_DBIN_FK FOREIGN KEY (DBIN_ID) REFERENCES DATABASE_INSTANCES(ID) ON DELETE CASCADE;
ALTER TABLE ROLE_ASSIGNMENTS ADD CONSTRAINT ROAS_SPACE_FK FOREIGN KEY (SPACE_ID) REFERENCES SPACES(ID) ON DELETE CASCADE;
ALTER TABLE ROLE_ASSIGNMENTS ADD CONSTRAINT ROAS_PERS_FK_GRANTEE FOREIGN KEY (PERS_ID_GRANTEE) REFERENCES PERSONS(ID) ON DELETE CASCADE;
ALTER TABLE ROLE_ASSIGNMENTS ADD CONSTRAINT ROAS_AG_FK_GRANTEE FOREIGN KEY (AG_ID_GRANTEE) REFERENCES AUTHORIZATION_GROUPS(ID) ON DELETE CASCADE;
