From f281749b8c5fbd80b77159f170a5ab173ec69d71 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sun, 8 Apr 2018 19:29:56 +0200 Subject: [PATCH] feat(migrations): Default 'posted' columns to NOW() --- migrations/2018-04-08-172739_default_posted/down.sql | 2 ++ migrations/2018-04-08-172739_default_posted/up.sql | 2 ++ 2 files changed, 4 insertions(+) create mode 100644 migrations/2018-04-08-172739_default_posted/down.sql create mode 100644 migrations/2018-04-08-172739_default_posted/up.sql diff --git a/migrations/2018-04-08-172739_default_posted/down.sql b/migrations/2018-04-08-172739_default_posted/down.sql new file mode 100644 index 000000000..64dc07e06 --- /dev/null +++ b/migrations/2018-04-08-172739_default_posted/down.sql @@ -0,0 +1,2 @@ +ALTER TABLE threads ALTER COLUMN posted DROP DEFAULT; +ALTER TABLE posts ALTER COLUMN posted DROP DEFAULT; diff --git a/migrations/2018-04-08-172739_default_posted/up.sql b/migrations/2018-04-08-172739_default_posted/up.sql new file mode 100644 index 000000000..afca8181c --- /dev/null +++ b/migrations/2018-04-08-172739_default_posted/up.sql @@ -0,0 +1,2 @@ +ALTER TABLE threads ALTER COLUMN posted SET DEFAULT (NOW() AT TIME ZONE 'UTC'); +ALTER TABLE posts ALTER COLUMN posted SET DEFAULT (NOW() AT TIME ZONE 'UTC');