From 5c6bfb09d2724285a523388f13d20da417033943 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Thu, 19 Dec 2024 16:49:24 +0100 Subject: [PATCH 1/2] add table --- hasura.planx.uk/metadata/tables.yaml | 3 +++ .../down.sql | 1 + .../up.sql | 8 ++++++++ 3 files changed, 12 insertions(+) create mode 100644 hasura.planx.uk/migrations/1734623060683_create_table_public_temp_data_migrations_audit/down.sql create mode 100644 hasura.planx.uk/migrations/1734623060683_create_table_public_temp_data_migrations_audit/up.sql diff --git a/hasura.planx.uk/metadata/tables.yaml b/hasura.planx.uk/metadata/tables.yaml index 2557257e6c..08eff087f1 100644 --- a/hasura.planx.uk/metadata/tables.yaml +++ b/hasura.planx.uk/metadata/tables.yaml @@ -2464,6 +2464,9 @@ - subdomain filter: {} comment: "" +- table: + name: temp_data_migrations_audit + schema: public - table: name: uniform_applications schema: public diff --git a/hasura.planx.uk/migrations/1734623060683_create_table_public_temp_data_migrations_audit/down.sql b/hasura.planx.uk/migrations/1734623060683_create_table_public_temp_data_migrations_audit/down.sql new file mode 100644 index 0000000000..7f6f79b6ee --- /dev/null +++ b/hasura.planx.uk/migrations/1734623060683_create_table_public_temp_data_migrations_audit/down.sql @@ -0,0 +1 @@ +DROP TABLE "public"."temp_data_migrations_audit"; diff --git a/hasura.planx.uk/migrations/1734623060683_create_table_public_temp_data_migrations_audit/up.sql b/hasura.planx.uk/migrations/1734623060683_create_table_public_temp_data_migrations_audit/up.sql new file mode 100644 index 0000000000..221ccc97a1 --- /dev/null +++ b/hasura.planx.uk/migrations/1734623060683_create_table_public_temp_data_migrations_audit/up.sql @@ -0,0 +1,8 @@ +CREATE TABLE "public"."temp_data_migrations_audit" ( + "flow_id" uuid NOT NULL, + "team_id" integer NOT NULL, + "updated" boolean NOT NULL DEFAULT false, + "updated_at" timestamptz NOT NULL DEFAULT now(), + PRIMARY KEY ("flow_id") +); +COMMENT ON TABLE "public"."temp_data_migrations_audit" IS E'Basic table structure that we can use to track status of data migrations. Contents of this table are ephemeral and may be truncated between migrations'; From b348984de63dc4eb3a147dcfff8b265b11460d9e Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Thu, 19 Dec 2024 17:30:54 +0100 Subject: [PATCH 2/2] add relationship to flows table --- hasura.planx.uk/metadata/tables.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/hasura.planx.uk/metadata/tables.yaml b/hasura.planx.uk/metadata/tables.yaml index 08eff087f1..806ad6332e 100644 --- a/hasura.planx.uk/metadata/tables.yaml +++ b/hasura.planx.uk/metadata/tables.yaml @@ -2467,6 +2467,16 @@ - table: name: temp_data_migrations_audit schema: public + object_relationships: + - name: flows + using: + manual_configuration: + column_mapping: + flow_id: id + insertion_order: null + remote_table: + name: flows + schema: public - table: name: uniform_applications schema: public