From 2183cb18eb2ee96547284335f6dfa8c8b6a7fe39 Mon Sep 17 00:00:00 2001 From: Rory Doak <138574807+RODO94@users.noreply.github.com> Date: Tue, 25 Jun 2024 11:23:34 +0100 Subject: [PATCH] chore: Remove ``has_planning_data`` from team_settings table (#3314) --- .../Settings/GeneralSettings/index.tsx | 6 ------ hasura.planx.uk/metadata/tables.yaml | 18 ++++++------------ .../down.sql | 4 ++++ .../up.sql | 1 + 4 files changed, 11 insertions(+), 18 deletions(-) create mode 100644 hasura.planx.uk/migrations/1719307850258_alter_table_public_team_settings_drop_column_has_planning_data/down.sql create mode 100644 hasura.planx.uk/migrations/1719307850258_alter_table_public_team_settings_drop_column_has_planning_data/up.sql diff --git a/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/index.tsx b/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/index.tsx index 7ce9edd670..4f4ee0195f 100644 --- a/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/index.tsx +++ b/editor.planx.uk/src/pages/FlowEditor/components/Settings/GeneralSettings/index.tsx @@ -15,9 +15,6 @@ export interface GeneralSettings { helpPhone: string; helpOpeningHours: string; homepage: string; - isPlanningDataCollected: boolean; - portalName: string; - portalUrl: string; } export interface FormProps { @@ -36,9 +33,6 @@ const GeneralSettings: React.FC = () => { helpPhone: "", helpOpeningHours: "", homepage: "", - isPlanningDataCollected: true, - portalName: "", - portalUrl: "", }; useEffect(() => { diff --git a/hasura.planx.uk/metadata/tables.yaml b/hasura.planx.uk/metadata/tables.yaml index d96ec6375d..e920555a75 100644 --- a/hasura.planx.uk/metadata/tables.yaml +++ b/hasura.planx.uk/metadata/tables.yaml @@ -1660,9 +1660,6 @@ - role: api permission: columns: - - has_planning_data - - id - - team_id - boundary_json - boundary_url - email_reply_to_id @@ -1672,15 +1669,14 @@ - help_opening_hours - help_phone - homepage + - id - reference_code + - team_id filter: {} comment: "" - role: platformAdmin permission: columns: - - has_planning_data - - id - - team_id - boundary_json - boundary_url - email_reply_to_id @@ -1690,7 +1686,9 @@ - help_opening_hours - help_phone - homepage + - id - reference_code + - team_id filter: {} comment: "" - role: public @@ -1700,7 +1698,6 @@ - boundary_url - external_planning_site_name - external_planning_site_url - - has_planning_data - homepage - id - reference_code @@ -1710,9 +1707,6 @@ - role: teamEditor permission: columns: - - has_planning_data - - id - - team_id - boundary_json - boundary_url - email_reply_to_id @@ -1722,7 +1716,9 @@ - help_opening_hours - help_phone - homepage + - id - reference_code + - team_id filter: {} comment: "" update_permissions: @@ -1733,7 +1729,6 @@ - email_reply_to_id - external_planning_site_name - external_planning_site_url - - has_planning_data - help_email - help_opening_hours - help_phone @@ -1749,7 +1744,6 @@ - email_reply_to_id - external_planning_site_name - external_planning_site_url - - has_planning_data - help_email - help_opening_hours - help_phone diff --git a/hasura.planx.uk/migrations/1719307850258_alter_table_public_team_settings_drop_column_has_planning_data/down.sql b/hasura.planx.uk/migrations/1719307850258_alter_table_public_team_settings_drop_column_has_planning_data/down.sql new file mode 100644 index 0000000000..0fc61106ff --- /dev/null +++ b/hasura.planx.uk/migrations/1719307850258_alter_table_public_team_settings_drop_column_has_planning_data/down.sql @@ -0,0 +1,4 @@ +alter table "public"."team_settings" add column "has_planning_data" bool; +comment on column "public"."team_settings"."has_planning_data" is E'Global settings for boundary and contact details'; +alter table "public"."team_settings" alter column "has_planning_data" set default false; +alter table "public"."team_settings" alter column "has_planning_data" drop not null; diff --git a/hasura.planx.uk/migrations/1719307850258_alter_table_public_team_settings_drop_column_has_planning_data/up.sql b/hasura.planx.uk/migrations/1719307850258_alter_table_public_team_settings_drop_column_has_planning_data/up.sql new file mode 100644 index 0000000000..e24d901a31 --- /dev/null +++ b/hasura.planx.uk/migrations/1719307850258_alter_table_public_team_settings_drop_column_has_planning_data/up.sql @@ -0,0 +1 @@ +alter table "public"."team_settings" drop column "has_planning_data" cascade;