aboutsummaryrefslogtreecommitdiffstats
path: root/migrations/2020-08-23-140315_fix_screening_timestamps/up.sql
diff options
context:
space:
mode:
Diffstat (limited to 'migrations/2020-08-23-140315_fix_screening_timestamps/up.sql')
-rw-r--r--migrations/2020-08-23-140315_fix_screening_timestamps/up.sql10
1 files changed, 10 insertions, 0 deletions
diff --git a/migrations/2020-08-23-140315_fix_screening_timestamps/up.sql b/migrations/2020-08-23-140315_fix_screening_timestamps/up.sql
new file mode 100644
index 0000000..fd08e80
--- /dev/null
+++ b/migrations/2020-08-23-140315_fix_screening_timestamps/up.sql
@@ -0,0 +1,10 @@
+-- Change the type of start and end times to include data and timezone.
+-- Drop the now obsolete date table
+ALTER TABLE screenings
+ ALTER COLUMN start_time TYPE timestamp with time zone
+ USING date::TIMESTAMP + start_time,
+
+ ALTER COLUMN end_time TYPE timestamp with time zone
+ USING date::TIMESTAMP + end_time,
+
+ DROP COLUMN date;