diff --git a/backend/sql/4-create_organization_post.sql b/backend/sql/4-create_organization_post.sql index 013aa7f..4a24677 100644 --- a/backend/sql/4-create_organization_post.sql +++ b/backend/sql/4-create_organization_post.sql @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS public."OrganizationPost" CONSTRAINT "AuthorIdFK" FOREIGN KEY (original_author) REFERENCES public."Person" (id) MATCH SIMPLE ON UPDATE NO ACTION - ON DELETE NO ACTION + ON DELETE CASCADE NOT VALID, CONSTRAINT "OrganizationIdFk" FOREIGN KEY (organization_id) REFERENCES public."Organization" (id) MATCH SIMPLE diff --git a/backend/sql/5-create_organization_administrator.sql b/backend/sql/5-create_organization_administrator.sql index a98a5b5..48caff4 100644 --- a/backend/sql/5-create_organization_administrator.sql +++ b/backend/sql/5-create_organization_administrator.sql @@ -10,12 +10,12 @@ CREATE TABLE IF NOT EXISTS public."OrganizationAdministrator" CONSTRAINT "OrganizationAdministratorOrganizationId" FOREIGN KEY (id_organization) REFERENCES public."Organization" (id) MATCH SIMPLE ON UPDATE NO ACTION - ON DELETE NO ACTION + ON DELETE CASCADE NOT VALID, CONSTRAINT "OrganizationAdministratorUserId" FOREIGN KEY (id_person) REFERENCES public."Person" (id) MATCH SIMPLE ON UPDATE NO ACTION - ON DELETE NO ACTION + ON DELETE CASCADE ) TABLESPACE pg_default;