From d9d2b8dd73bd129206b442dc18732ba86031ace0 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Fri, 6 Sep 2024 09:38:36 +0100 Subject: [PATCH] drop column and adjust write script --- hasura.planx.uk/metadata/tables.yaml | 29 ------------------- .../down.sql | 3 ++ .../up.sql | 1 + scripts/seed-database/write/teams.sql | 1 - 4 files changed, 4 insertions(+), 30 deletions(-) create mode 100644 hasura.planx.uk/migrations/1725611185485_alter_table_public_teams_drop_column_submission_email/down.sql create mode 100644 hasura.planx.uk/migrations/1725611185485_alter_table_public_teams_drop_column_submission_email/up.sql diff --git a/hasura.planx.uk/metadata/tables.yaml b/hasura.planx.uk/metadata/tables.yaml index cd7a62e911..f3e3a34e85 100644 --- a/hasura.planx.uk/metadata/tables.yaml +++ b/hasura.planx.uk/metadata/tables.yaml @@ -2055,7 +2055,6 @@ - notify_personalisation - settings - slug - - submission_email - updated_at select_permissions: - role: api @@ -2070,7 +2069,6 @@ - reference_code - settings - slug - - submission_email - updated_at computed_fields: - boundary_bbox @@ -2130,35 +2128,8 @@ - notify_personalisation - settings - slug - - submission_email filter: {} check: null -- table: - name: teams_summary - schema: public - select_permissions: - - role: platformAdmin - permission: - columns: - - govpay_enabled - - planning_data_enabled - - id - - govnotify_personalisation - - action_colour - - article_4s_enabled - - bops_submission_url - - favicon - - homepage - - link_colour - - logo - - name - - primary_colour - - reference_code - - send_to_email_address - - slug - - subdomain - filter: {} - comment: "" - table: name: uniform_applications schema: public diff --git a/hasura.planx.uk/migrations/1725611185485_alter_table_public_teams_drop_column_submission_email/down.sql b/hasura.planx.uk/migrations/1725611185485_alter_table_public_teams_drop_column_submission_email/down.sql new file mode 100644 index 0000000000..bf193e696b --- /dev/null +++ b/hasura.planx.uk/migrations/1725611185485_alter_table_public_teams_drop_column_submission_email/down.sql @@ -0,0 +1,3 @@ +comment on column "public"."teams"."submission_email" is E'Teams are core way we organise `flows` and configure settings like theme colour, logo, and contact info; name usually reflects a council but not exclusively'; +alter table "public"."teams" alter column "submission_email" drop not null; +alter table "public"."teams" add column "submission_email" text; diff --git a/hasura.planx.uk/migrations/1725611185485_alter_table_public_teams_drop_column_submission_email/up.sql b/hasura.planx.uk/migrations/1725611185485_alter_table_public_teams_drop_column_submission_email/up.sql new file mode 100644 index 0000000000..b9b844b49c --- /dev/null +++ b/hasura.planx.uk/migrations/1725611185485_alter_table_public_teams_drop_column_submission_email/up.sql @@ -0,0 +1 @@ +alter table "public"."teams" drop column "submission_email" cascade; diff --git a/scripts/seed-database/write/teams.sql b/scripts/seed-database/write/teams.sql index 7cc3c73dde..5a8e6bc5dc 100644 --- a/scripts/seed-database/write/teams.sql +++ b/scripts/seed-database/write/teams.sql @@ -8,7 +8,6 @@ CREATE TEMPORARY TABLE sync_teams ( settings jsonb, notify_personalisation jsonb, domain text, - submission_email text, boundary jsonb, reference_code text );