From e2717ab8d35ffcf588f48f40ec605d1dea40019e Mon Sep 17 00:00:00 2001 From: Mateusz Kwasniewski Date: Mon, 14 Aug 2023 14:59:28 +0200 Subject: [PATCH] fix: add timezones to timestamps (#4488) --- ...15436-change-request-timzone-timestamps.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/migrations/20230814115436-change-request-timzone-timestamps.js diff --git a/src/migrations/20230814115436-change-request-timzone-timestamps.js b/src/migrations/20230814115436-change-request-timzone-timestamps.js new file mode 100644 index 0000000000..e6e3fc1716 --- /dev/null +++ b/src/migrations/20230814115436-change-request-timzone-timestamps.js @@ -0,0 +1,19 @@ +'use strict'; + +exports.up = function (db, callback) { + db.runSql( + ` + ALTER TABLE change_request_rejections ALTER COLUMN created_at TYPE TIMESTAMP WITH TIME ZONE; + ALTER TABLE change_request_approvals ALTER COLUMN created_at TYPE TIMESTAMP WITH TIME ZONE; + ALTER TABLE change_request_comments ALTER COLUMN created_at TYPE TIMESTAMP WITH TIME ZONE; + ALTER TABLE change_request_events ALTER COLUMN created_at TYPE TIMESTAMP WITH TIME ZONE; + ALTER TABLE change_requests ALTER COLUMN created_at TYPE TIMESTAMP WITH TIME ZONE; + + `, + callback, + ); +}; + +exports.down = function (db, callback) { + callback(); +};