From 5771ae51fcad7cfe28a3db10444c17f5a1843278 Mon Sep 17 00:00:00 2001 From: Torresmorah Date: Fri, 10 Mar 2023 15:44:08 -0600 Subject: [PATCH] feat(hasura): add endpoints check history table --- .../default/tables/public_endpoints_check_history.yaml | 3 +++ hasura/metadata/databases/default/tables/tables.yaml | 1 + .../down.sql | 1 + .../up.sql | 2 ++ 4 files changed, 7 insertions(+) create mode 100644 hasura/metadata/databases/default/tables/public_endpoints_check_history.yaml create mode 100644 hasura/migrations/default/1678393517233_create_table_public_endpoints_check_history/down.sql create mode 100644 hasura/migrations/default/1678393517233_create_table_public_endpoints_check_history/up.sql diff --git a/hasura/metadata/databases/default/tables/public_endpoints_check_history.yaml b/hasura/metadata/databases/default/tables/public_endpoints_check_history.yaml new file mode 100644 index 00000000..b1badbbe --- /dev/null +++ b/hasura/metadata/databases/default/tables/public_endpoints_check_history.yaml @@ -0,0 +1,3 @@ +table: + name: endpoints_check_history + schema: public diff --git a/hasura/metadata/databases/default/tables/tables.yaml b/hasura/metadata/databases/default/tables/tables.yaml index 951bdcae..6b432c6b 100644 --- a/hasura/metadata/databases/default/tables/tables.yaml +++ b/hasura/metadata/databases/default/tables/tables.yaml @@ -4,6 +4,7 @@ - "!include public_demux_state.yaml" - "!include public_endpoint.yaml" - "!include public_endpoints_by_producer_id.yaml" +- "!include public_endpoints_check_history.yaml" - "!include public_health_check_history.yaml" - "!include public_node.yaml" - "!include public_node_info.yaml" diff --git a/hasura/migrations/default/1678393517233_create_table_public_endpoints_check_history/down.sql b/hasura/migrations/default/1678393517233_create_table_public_endpoints_check_history/down.sql new file mode 100644 index 00000000..828abe03 --- /dev/null +++ b/hasura/migrations/default/1678393517233_create_table_public_endpoints_check_history/down.sql @@ -0,0 +1 @@ +DROP TABLE "public"."endpoints_check_history"; diff --git a/hasura/migrations/default/1678393517233_create_table_public_endpoints_check_history/up.sql b/hasura/migrations/default/1678393517233_create_table_public_endpoints_check_history/up.sql new file mode 100644 index 00000000..fd401ef9 --- /dev/null +++ b/hasura/migrations/default/1678393517233_create_table_public_endpoints_check_history/up.sql @@ -0,0 +1,2 @@ +CREATE TABLE "public"."endpoints_check_history" ("id" uuid NOT NULL DEFAULT gen_random_uuid(), "successful_checks" integer NOT NULL, "sum_total_time" integer NOT NULL, "value" varchar NOT NULL, "date" date NOT NULL, "producer_id" integer NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("producer_id") REFERENCES "public"."producer"("id") ON UPDATE restrict ON DELETE cascade, UNIQUE ("id")); +CREATE EXTENSION IF NOT EXISTS pgcrypto;