From 9eda39cce2027353c42168e475d226891c58908e Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Wed, 13 Nov 2024 11:50:09 +0000 Subject: [PATCH 1/3] add new columns and update permissions --- hasura.planx.uk/metadata/tables.yaml | 12 ++++++++++++ .../down.sql | 3 +++ .../up.sql | 1 + .../down.sql | 3 +++ .../up.sql | 1 + 5 files changed, 20 insertions(+) create mode 100644 hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql create mode 100644 hasura.planx.uk/migrations/1731498412695_add description column to flows/up.sql create mode 100644 hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql create mode 100644 hasura.planx.uk/migrations/1731498447017_add template from column to flows/up.sql diff --git a/hasura.planx.uk/metadata/tables.yaml b/hasura.planx.uk/metadata/tables.yaml index f07ac12be2..b264d7a76e 100644 --- a/hasura.planx.uk/metadata/tables.yaml +++ b/hasura.planx.uk/metadata/tables.yaml @@ -472,6 +472,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -500,6 +501,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -518,6 +520,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -551,6 +554,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -575,6 +579,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -594,6 +599,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -626,6 +632,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -664,6 +671,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -684,6 +692,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -710,6 +719,7 @@ - created_at - creator_id - data + - description - id - name - settings @@ -729,6 +739,7 @@ permission: columns: - data + - description - name - settings - slug @@ -749,6 +760,7 @@ permission: columns: - data + - description - name - settings - slug diff --git a/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql b/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql new file mode 100644 index 0000000000..13e85571bd --- /dev/null +++ b/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql @@ -0,0 +1,3 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."flows" add column "description" text; diff --git a/hasura.planx.uk/migrations/1731498412695_add description column to flows/up.sql b/hasura.planx.uk/migrations/1731498412695_add description column to flows/up.sql new file mode 100644 index 0000000000..f20e6bfd5e --- /dev/null +++ b/hasura.planx.uk/migrations/1731498412695_add description column to flows/up.sql @@ -0,0 +1 @@ +alter table "public"."flows" add column "description" text; diff --git a/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql b/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql new file mode 100644 index 0000000000..6fb02ff107 --- /dev/null +++ b/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql @@ -0,0 +1,3 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."flows" add column "templated_from" timestamp; diff --git a/hasura.planx.uk/migrations/1731498447017_add template from column to flows/up.sql b/hasura.planx.uk/migrations/1731498447017_add template from column to flows/up.sql new file mode 100644 index 0000000000..615303e0b1 --- /dev/null +++ b/hasura.planx.uk/migrations/1731498447017_add template from column to flows/up.sql @@ -0,0 +1 @@ +alter table "public"."flows" add column "templated_from" timestamp; From 8356f992410ad269067c3fa84ee75ff83037d294 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Wed, 13 Nov 2024 11:51:50 +0000 Subject: [PATCH 2/3] add drop columns --- .../1731498412695_add description column to flows/down.sql | 4 +--- .../1731498447017_add template from column to flows/down.sql | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql b/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql index 13e85571bd..def2473157 100644 --- a/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql +++ b/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql @@ -1,3 +1 @@ --- Could not auto-generate a down migration. --- Please write an appropriate down migration for the SQL below: --- alter table "public"."flows" add column "description" text; +alter table "public"."flows" drop column "description"; \ No newline at end of file diff --git a/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql b/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql index 6fb02ff107..64c82118d9 100644 --- a/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql +++ b/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql @@ -1,3 +1 @@ --- Could not auto-generate a down migration. --- Please write an appropriate down migration for the SQL below: --- alter table "public"."flows" add column "templated_from" timestamp; +alter table "public"."flows" drop column "templated_from"; \ No newline at end of file From 9cb68dfce817e86cd7eb545cf46ee1a6f9f24087 Mon Sep 17 00:00:00 2001 From: Rory Doak Date: Wed, 13 Nov 2024 13:00:05 +0000 Subject: [PATCH 3/3] squash and alter templated from to uuid --- .../1731498412695_add description column to flows/down.sql | 1 - .../1731498412695_add description column to flows/up.sql | 1 - .../down.sql | 2 ++ .../up.sql | 3 +++ .../1731498447017_add template from column to flows/up.sql | 1 - 5 files changed, 5 insertions(+), 3 deletions(-) delete mode 100644 hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql delete mode 100644 hasura.planx.uk/migrations/1731498412695_add description column to flows/up.sql rename hasura.planx.uk/migrations/{1731498447017_add template from column to flows => 1731498412695_add_description_templated_from_to_flows}/down.sql (50%) create mode 100644 hasura.planx.uk/migrations/1731498412695_add_description_templated_from_to_flows/up.sql delete mode 100644 hasura.planx.uk/migrations/1731498447017_add template from column to flows/up.sql diff --git a/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql b/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql deleted file mode 100644 index def2473157..0000000000 --- a/hasura.planx.uk/migrations/1731498412695_add description column to flows/down.sql +++ /dev/null @@ -1 +0,0 @@ -alter table "public"."flows" drop column "description"; \ No newline at end of file diff --git a/hasura.planx.uk/migrations/1731498412695_add description column to flows/up.sql b/hasura.planx.uk/migrations/1731498412695_add description column to flows/up.sql deleted file mode 100644 index f20e6bfd5e..0000000000 --- a/hasura.planx.uk/migrations/1731498412695_add description column to flows/up.sql +++ /dev/null @@ -1 +0,0 @@ -alter table "public"."flows" add column "description" text; diff --git a/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql b/hasura.planx.uk/migrations/1731498412695_add_description_templated_from_to_flows/down.sql similarity index 50% rename from hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql rename to hasura.planx.uk/migrations/1731498412695_add_description_templated_from_to_flows/down.sql index 64c82118d9..6854e01de9 100644 --- a/hasura.planx.uk/migrations/1731498447017_add template from column to flows/down.sql +++ b/hasura.planx.uk/migrations/1731498412695_add_description_templated_from_to_flows/down.sql @@ -1 +1,3 @@ +alter table "public"."flows" drop column "description"; + alter table "public"."flows" drop column "templated_from"; \ No newline at end of file diff --git a/hasura.planx.uk/migrations/1731498412695_add_description_templated_from_to_flows/up.sql b/hasura.planx.uk/migrations/1731498412695_add_description_templated_from_to_flows/up.sql new file mode 100644 index 0000000000..49cb59d58b --- /dev/null +++ b/hasura.planx.uk/migrations/1731498412695_add_description_templated_from_to_flows/up.sql @@ -0,0 +1,3 @@ +alter table "public"."flows" add column "description" text; + +alter table "public"."flows" add column "templated_from" uuid; \ No newline at end of file diff --git a/hasura.planx.uk/migrations/1731498447017_add template from column to flows/up.sql b/hasura.planx.uk/migrations/1731498447017_add template from column to flows/up.sql deleted file mode 100644 index 615303e0b1..0000000000 --- a/hasura.planx.uk/migrations/1731498447017_add template from column to flows/up.sql +++ /dev/null @@ -1 +0,0 @@ -alter table "public"."flows" add column "templated_from" timestamp;