-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Handle everything internally as UTC - Display dates using the local timezone
- Loading branch information
Showing
18 changed files
with
425 additions
and
466 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
backend/migrations/2020-01-09-151700_use_timestamp_with_timezone/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
DROP VIEW events_with_signups; | ||
|
||
ALTER TABLE transactions | ||
ALTER COLUMN time TYPE timestamp without time zone; | ||
|
||
ALTER TABLE events | ||
ALTER COLUMN end_time TYPE timestamp without time zone, | ||
ALTER COLUMN start_time TYPE timestamp without time zone; | ||
|
||
CREATE OR REPLACE VIEW public.events_with_signups AS | ||
SELECT | ||
events.*, | ||
COALESCE(t_signup_count.count, 0) AS signups | ||
FROM | ||
events | ||
LEFT JOIN | ||
( | ||
SELECT | ||
count(id), | ||
event | ||
FROM | ||
event_signups | ||
GROUP BY | ||
event | ||
) t_signup_count | ||
ON events.id = t_signup_count.event; |
26 changes: 26 additions & 0 deletions
26
backend/migrations/2020-01-09-151700_use_timestamp_with_timezone/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
DROP VIEW events_with_signups; | ||
|
||
ALTER TABLE transactions | ||
ALTER COLUMN time TYPE timestamp with time zone; | ||
|
||
ALTER TABLE events | ||
ALTER COLUMN end_time TYPE timestamp with time zone, | ||
ALTER COLUMN start_time TYPE timestamp with time zone; | ||
|
||
CREATE OR REPLACE VIEW public.events_with_signups AS | ||
SELECT | ||
events.*, | ||
COALESCE(t_signup_count.count, 0) AS signups | ||
FROM | ||
events | ||
LEFT JOIN | ||
( | ||
SELECT | ||
count(id), | ||
event | ||
FROM | ||
event_signups | ||
GROUP BY | ||
event | ||
) t_signup_count | ||
ON events.id = t_signup_count.event; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.