Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAP-2533: Fix advert scheduler view for BST #273

Merged
merged 1 commit into from
Apr 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
-- Replace view for scheduler

DROP VIEW IF EXISTS ADVERT_SCHEDULER_VIEW;
CREATE VIEW ADVERT_SCHEDULER_VIEW AS
SELECT GRANT_ADVERT_ID AS ID,
CASE
WHEN
STATUS = 'SCHEDULED'
AND (OPENING_DATE AT TIME ZONE 'Europe/London') <= NOW() AT TIME ZONE 'Europe/London'
THEN 'PUBLISH'
WHEN
STATUS = 'PUBLISHED'
AND (CLOSING_DATE AT TIME ZONE 'Europe/London') <= NOW() AT TIME ZONE 'Europe/London'
THEN 'UNPUBLISH'
END AS ACTION
FROM GRANT_ADVERT
WHERE (
STATUS = 'SCHEDULED' AND (OPENING_DATE AT TIME ZONE 'Europe/London') <= NOW() AT TIME ZONE 'Europe/London'
) OR (
STATUS = 'PUBLISHED' AND (CLOSING_DATE AT TIME ZONE 'Europe/London') <= (NOW() AT TIME ZONE 'Europe/London')
);
Loading