From aa8b9955ef0c843e823faa69a410988625b635cb Mon Sep 17 00:00:00 2001 From: Igor Santos Date: Tue, 6 Aug 2024 20:52:39 -0300 Subject: [PATCH] feat(hasura): add database and event trigger on votepeloclima --- migrations/metadata/databases/databases.yaml | 9 +++++++++ .../public_candidature_candidatureflow.yaml | 15 +++++++++++++++ .../databases/votepeloclima/tables/tables.yaml | 1 + 3 files changed, 25 insertions(+) create mode 100644 migrations/metadata/databases/votepeloclima/tables/public_candidature_candidatureflow.yaml create mode 100644 migrations/metadata/databases/votepeloclima/tables/tables.yaml diff --git a/migrations/metadata/databases/databases.yaml b/migrations/metadata/databases/databases.yaml index 65adeb3..ddfba69 100644 --- a/migrations/metadata/databases/databases.yaml +++ b/migrations/metadata/databases/databases.yaml @@ -13,3 +13,12 @@ max_connections: 50 tables: "!include default/tables/tables.yaml" functions: "!include default/functions/functions.yaml" +- name: votepeloclima + kind: postgres + configuration: + connection_info: + use_prepared_statements: false + database_url: + from_env: HASURA_GRAPHQL_VOTEPELOCLIMA_DATABASE_URL + isolation_level: read-committed + tables: "!include votepeloclima/tables/tables.yaml" diff --git a/migrations/metadata/databases/votepeloclima/tables/public_candidature_candidatureflow.yaml b/migrations/metadata/databases/votepeloclima/tables/public_candidature_candidatureflow.yaml new file mode 100644 index 0000000..be29c4f --- /dev/null +++ b/migrations/metadata/databases/votepeloclima/tables/public_candidature_candidatureflow.yaml @@ -0,0 +1,15 @@ +table: + schema: public + name: candidature_candidatureflow +event_triggers: + - name: votepeloclima-validacao-cadastro + definition: + enable_manual: false + update: + columns: + - status + retry_conf: + num_retries: 0 + interval_sec: 10 + timeout_sec: 60 + webhook: '{{N8N_WEBHOOK_URL}}/votepeloclima/validacao/cadastro/' diff --git a/migrations/metadata/databases/votepeloclima/tables/tables.yaml b/migrations/metadata/databases/votepeloclima/tables/tables.yaml new file mode 100644 index 0000000..1a10c9b --- /dev/null +++ b/migrations/metadata/databases/votepeloclima/tables/tables.yaml @@ -0,0 +1 @@ +- "!include public_candidature_candidatureflow.yaml"