From d2d3180170b034f6e8c8e4363ec99ed6e2368d8c Mon Sep 17 00:00:00 2001 From: Callum May Date: Mon, 25 Nov 2024 15:11:22 -0500 Subject: [PATCH 1/3] add row-level ttl to scd_subscriptions table --- .../downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql | 1 + .../scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql create mode 100644 build/db_schemas/scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql diff --git a/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql b/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql new file mode 100644 index 000000000..8a73c54aa --- /dev/null +++ b/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql @@ -0,0 +1 @@ +ALTER TABLE events RESET (ttl); \ No newline at end of file diff --git a/build/db_schemas/scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql b/build/db_schemas/scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql new file mode 100644 index 000000000..d6f601c31 --- /dev/null +++ b/build/db_schemas/scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql @@ -0,0 +1,5 @@ +ALTER TABLE scd_subscriptions +SET ( + ttl_expiration_expression = 'ends_at', + ttl_job_cron = '@daily' +); \ No newline at end of file From 5d083c60935430b4b8e6b365d11572ab6e2e1edf Mon Sep 17 00:00:00 2001 From: Callum May Date: Mon, 25 Nov 2024 15:11:51 -0500 Subject: [PATCH 2/3] add end of lines --- .../scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql | 2 +- .../scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql b/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql index 8a73c54aa..067359786 100644 --- a/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql +++ b/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql @@ -1 +1 @@ -ALTER TABLE events RESET (ttl); \ No newline at end of file +ALTER TABLE events RESET (ttl); diff --git a/build/db_schemas/scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql b/build/db_schemas/scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql index d6f601c31..2ba76d145 100644 --- a/build/db_schemas/scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql +++ b/build/db_schemas/scd/upto-v3.3.0-add_scd_subscriptions_end_at_ttl.sql @@ -2,4 +2,4 @@ ALTER TABLE scd_subscriptions SET ( ttl_expiration_expression = 'ends_at', ttl_job_cron = '@daily' -); \ No newline at end of file +); From ca1c0c525c145d1ac6c57dd7b9da14d3d196d17a Mon Sep 17 00:00:00 2001 From: Callum May Date: Tue, 26 Nov 2024 11:55:39 -0500 Subject: [PATCH 3/3] fix --- .../scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql b/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql index 067359786..3cfabed9f 100644 --- a/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql +++ b/build/db_schemas/scd/downfrom-v3.3.0-remove_scd_subscriptions_end_at_ttl.sql @@ -1 +1 @@ -ALTER TABLE events RESET (ttl); +ALTER TABLE scd_subscriptions RESET (ttl);