From c8f8a86a98ee4e9f7e02ee13a2d53f90b3e0cf67 Mon Sep 17 00:00:00 2001 From: Dave Richer Date: Tue, 16 Apr 2024 15:45:56 -0400 Subject: [PATCH 1/2] - Migrations for remind_at_sent Signed-off-by: Dave Richer --- .../down.sql | 4 ++++ .../up.sql | 2 ++ 2 files changed, 6 insertions(+) create mode 100644 hasura/migrations/1712675814937_alter_table_public_tasks_add_column_remind_at_sent/down.sql create mode 100644 hasura/migrations/1712675814937_alter_table_public_tasks_add_column_remind_at_sent/up.sql diff --git a/hasura/migrations/1712675814937_alter_table_public_tasks_add_column_remind_at_sent/down.sql b/hasura/migrations/1712675814937_alter_table_public_tasks_add_column_remind_at_sent/down.sql new file mode 100644 index 000000000..e99e3e8d7 --- /dev/null +++ b/hasura/migrations/1712675814937_alter_table_public_tasks_add_column_remind_at_sent/down.sql @@ -0,0 +1,4 @@ +-- Could not auto-generate a down migration. +-- Please write an appropriate down migration for the SQL below: +-- alter table "public"."tasks" add column "remind_at_sent" timestamptz +-- null; diff --git a/hasura/migrations/1712675814937_alter_table_public_tasks_add_column_remind_at_sent/up.sql b/hasura/migrations/1712675814937_alter_table_public_tasks_add_column_remind_at_sent/up.sql new file mode 100644 index 000000000..601b9d8b5 --- /dev/null +++ b/hasura/migrations/1712675814937_alter_table_public_tasks_add_column_remind_at_sent/up.sql @@ -0,0 +1,2 @@ +alter table "public"."tasks" add column "remind_at_sent" timestamptz + null; From 878e81dc8f18927da9cbdccbd66c8f0273936617 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 16 Apr 2024 16:02:25 -0700 Subject: [PATCH 2/2] Hasura schema changes for tasks. --- hasura/metadata/cron_triggers.yaml | 9 ++++++++- hasura/metadata/tables.yaml | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/hasura/metadata/cron_triggers.yaml b/hasura/metadata/cron_triggers.yaml index fe51488c7..68c1abdde 100644 --- a/hasura/metadata/cron_triggers.yaml +++ b/hasura/metadata/cron_triggers.yaml @@ -1 +1,8 @@ -[] +- name: Task Reminders + webhook: '{{HASURA_API_URL}}/tasks-remind-handler' + schedule: '*/1 * * * *' + include_in_metadata: true + payload: {} + headers: + - name: event-secret + value_from_env: EVENT_SECRET diff --git a/hasura/metadata/tables.yaml b/hasura/metadata/tables.yaml index 7a9de6b10..94cba47e3 100644 --- a/hasura/metadata/tables.yaml +++ b/hasura/metadata/tables.yaml @@ -5797,6 +5797,29 @@ - active: _eq: true check: null + event_triggers: + - name: tasks_assigned_changed + definition: + enable_manual: false + insert: + columns: '*' + update: + columns: + - assigned_to + retry_conf: + interval_sec: 10 + num_retries: 3 + timeout_sec: 60 + webhook_from_env: HASURA_API_URL + headers: + - name: event-secret + value_from_env: EVENT_SECRET + request_transform: + method: POST + query_params: {} + template_engine: Kriti + url: '{{$base_url}}/tasks-assigned-handler' + version: 2 - table: name: timetickets schema: public