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;