From 3aacd5de46ee2f7e87b8c9cfe0c08a0300b414b7 Mon Sep 17 00:00:00 2001 From: dominicwest <101722961+dominicwest@users.noreply.github.com> Date: Tue, 2 Apr 2024 13:56:46 +0100 Subject: [PATCH] GAP-2533: Retrospectively fix BST ads in prod (#276) * GAP-2533: Retrospectively fix BST ads in prod * GAP-2533: Including release time * GAP-2533: Overriding UTC opening/closing dates as Europe/London time * GAP-2533: Update scheduled closing times too * GAP-2533: Fix syntax * GAP-2533: Hard code datetimes for BST --- .../V1_101__retrospectively_fix_bst_ads.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/main/resources/db/migration/V1_101__retrospectively_fix_bst_ads.sql diff --git a/src/main/resources/db/migration/V1_101__retrospectively_fix_bst_ads.sql b/src/main/resources/db/migration/V1_101__retrospectively_fix_bst_ads.sql new file mode 100644 index 00000000..a593eac1 --- /dev/null +++ b/src/main/resources/db/migration/V1_101__retrospectively_fix_bst_ads.sql @@ -0,0 +1,13 @@ +UPDATE grant_advert + SET opening_date = opening_date - INTERVAL '1 hour' +WHERE opening_date > '2024-03-31 01:00:00'::TIMESTAMP + AND opening_date < '2024-10-27 02:00:00'::TIMESTAMP + AND created > '2023-09-28 12:00:00'::TIMESTAMP + AND status = 'SCHEDULED'; + +UPDATE grant_advert + SET closing_date = closing_date - INTERVAL '1 hour' +WHERE closing_date > '2024-03-31 01:00:00'::TIMESTAMP + AND closing_date < '2024-10-27 02:00:00'::TIMESTAMP + AND created > '2023-09-28 12:00:00'::TIMESTAMP + AND (status = 'PUBLISHED' OR status = 'SCHEDULED'); \ No newline at end of file