-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: remove back-ref for creators, ensure tests for adding creators …
…groups (#440)
- Loading branch information
1 parent
e19919f
commit f4529dc
Showing
38 changed files
with
3,578 additions
and
11,079 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- +goose Up | ||
-- modify "groups" table | ||
ALTER TABLE "groups" ADD COLUMN "organization_control_creators" character varying NULL, ADD COLUMN "organization_control_objective_creators" character varying NULL, ADD COLUMN "organization_group_creators" character varying NULL, ADD COLUMN "organization_internal_policy_creators" character varying NULL, ADD COLUMN "organization_narrative_creators" character varying NULL, ADD COLUMN "organization_procedure_creators" character varying NULL, ADD COLUMN "organization_program_creators" character varying NULL, ADD COLUMN "organization_risk_creators" character varying NULL, ADD COLUMN "organization_template_creators" character varying NULL, ADD CONSTRAINT "groups_organizations_control_creators" FOREIGN KEY ("organization_control_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_control_objective_creators" FOREIGN KEY ("organization_control_objective_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_group_creators" FOREIGN KEY ("organization_group_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_internal_policy_creators" FOREIGN KEY ("organization_internal_policy_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_narrative_creators" FOREIGN KEY ("organization_narrative_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_procedure_creators" FOREIGN KEY ("organization_procedure_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_program_creators" FOREIGN KEY ("organization_program_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_risk_creators" FOREIGN KEY ("organization_risk_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_template_creators" FOREIGN KEY ("organization_template_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL; | ||
|
||
-- +goose Down | ||
-- reverse: modify "groups" table | ||
ALTER TABLE "groups" DROP CONSTRAINT "groups_organizations_template_creators", DROP CONSTRAINT "groups_organizations_risk_creators", DROP CONSTRAINT "groups_organizations_program_creators", DROP CONSTRAINT "groups_organizations_procedure_creators", DROP CONSTRAINT "groups_organizations_narrative_creators", DROP CONSTRAINT "groups_organizations_internal_policy_creators", DROP CONSTRAINT "groups_organizations_group_creators", DROP CONSTRAINT "groups_organizations_control_objective_creators", DROP CONSTRAINT "groups_organizations_control_creators", DROP COLUMN "organization_template_creators", DROP COLUMN "organization_risk_creators", DROP COLUMN "organization_program_creators", DROP COLUMN "organization_procedure_creators", DROP COLUMN "organization_narrative_creators", DROP COLUMN "organization_internal_policy_creators", DROP COLUMN "organization_group_creators", DROP COLUMN "organization_control_objective_creators", DROP COLUMN "organization_control_creators"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
-- Modify "groups" table | ||
ALTER TABLE "groups" ADD COLUMN "organization_control_creators" character varying NULL, ADD COLUMN "organization_control_objective_creators" character varying NULL, ADD COLUMN "organization_group_creators" character varying NULL, ADD COLUMN "organization_internal_policy_creators" character varying NULL, ADD COLUMN "organization_narrative_creators" character varying NULL, ADD COLUMN "organization_procedure_creators" character varying NULL, ADD COLUMN "organization_program_creators" character varying NULL, ADD COLUMN "organization_risk_creators" character varying NULL, ADD COLUMN "organization_template_creators" character varying NULL, ADD CONSTRAINT "groups_organizations_control_creators" FOREIGN KEY ("organization_control_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_control_objective_creators" FOREIGN KEY ("organization_control_objective_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_group_creators" FOREIGN KEY ("organization_group_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_internal_policy_creators" FOREIGN KEY ("organization_internal_policy_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_narrative_creators" FOREIGN KEY ("organization_narrative_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_procedure_creators" FOREIGN KEY ("organization_procedure_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_program_creators" FOREIGN KEY ("organization_program_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_risk_creators" FOREIGN KEY ("organization_risk_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL, ADD CONSTRAINT "groups_organizations_template_creators" FOREIGN KEY ("organization_template_creators") REFERENCES "organizations" ("id") ON UPDATE NO ACTION ON DELETE SET NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.