feat: add migrations for posts timefields

This commit is contained in:
Yanislav Igonin 2021-11-20 18:48:46 +02:00
parent 52e3f9ae90
commit 9e8e860cf5
3 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,9 @@
ALTER TABLE posts
ALTER COLUMN updated_at DROP NOT NULL;
ALTER TABLE posts
ALTER COLUMN updated_at DROP DEFAULT;
UPDATE posts
SET updated_at = null
WHERE is_parent != true;

View File

@ -0,0 +1,5 @@
ALTER TABLE posts
ALTER COLUMN created_at TYPE timestamptz;
ALTER TABLE posts
ALTER COLUMN updated_at TYPE timestamptz;