From 46256bbb459779423956006263be0ed56bf028ea Mon Sep 17 00:00:00 2001 From: Juho Haapakoski Date: Wed, 16 Oct 2024 18:36:09 +0300 Subject: [PATCH] AE-2274: Put now into Helsinki's timezone in expiration comparsions --- .../main/sql/solita/etp/db/energiatodistus-destruction.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etp-core/etp-backend/src/main/sql/solita/etp/db/energiatodistus-destruction.sql b/etp-core/etp-backend/src/main/sql/solita/etp/db/energiatodistus-destruction.sql index cd952cc7a..78f29bd97 100644 --- a/etp-core/etp-backend/src/main/sql/solita/etp/db/energiatodistus-destruction.sql +++ b/etp-core/etp-backend/src/main/sql/solita/etp/db/energiatodistus-destruction.sql @@ -5,8 +5,8 @@ from energiatodistus from vo_toimenpide group by energiatodistus_id) latest_toimenpide on energiatodistus.id = latest_toimenpide.energiatodistus_id -where voimassaolo_paattymisaika < current_date - and (latest_toimenpide_create_time < current_date - interval '2 years' +where voimassaolo_paattymisaika < (now() at time zone 'Europe/Helsinki')::date - interval '1 days' + and (latest_toimenpide_create_time < (now() at time zone 'Europe/Helsinki')::date - interval '2 years' or latest_toimenpide_create_time is null); -- name: select-vo-toimenpiteet-by-energiatodistus-id