From d3a6a99e9c1751ec08bed526d4ce7237425cdf73 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 23 Aug 2020 17:06:24 +0200 Subject: Change start/end times to complete timestamps. The way we had this until now with a date and separate start and end times does not really work. There are cases when a screening starts on one day, but ends on the next. By keeping a complete timestamp for both the start and end times, we don't fall into this problem. --- migrations/2020-08-23-140315_fix_screening_timestamps/down.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 migrations/2020-08-23-140315_fix_screening_timestamps/down.sql (limited to 'migrations/2020-08-23-140315_fix_screening_timestamps/down.sql') diff --git a/migrations/2020-08-23-140315_fix_screening_timestamps/down.sql b/migrations/2020-08-23-140315_fix_screening_timestamps/down.sql new file mode 100644 index 0000000..49ceb2c --- /dev/null +++ b/migrations/2020-08-23-140315_fix_screening_timestamps/down.sql @@ -0,0 +1,7 @@ +-- Revert date and timestamps back to separate state. +-- There should be no reason to do this, but included for completeness- +-- This will re-add the 'date' column, but not set the proper date. +ALTER TABLE screenings + ADD COLUMN date TYPE DATE NOT NULL, + ALTER COLUMN start_time TYPE TIME, + ALTER COLUMN end_time TYPE TIME; -- cgit v1.2.3