mirror of
https://github.com/yanislav-igonin/micrach
synced 2025-07-02 01:11:14 +03:00
feat: add migrations for posts timefields
This commit is contained in:
parent
52e3f9ae90
commit
9e8e860cf5
9
migrations/3-remove_posts_updated_at_default.sql
Normal file
9
migrations/3-remove_posts_updated_at_default.sql
Normal 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;
|
5
migrations/4-posts_timefields_now_with_timezone.sql
Normal file
5
migrations/4-posts_timefields_now_with_timezone.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
ALTER TABLE posts
|
||||||
|
ALTER COLUMN created_at TYPE timestamptz;
|
||||||
|
|
||||||
|
ALTER TABLE posts
|
||||||
|
ALTER COLUMN updated_at TYPE timestamptz;
|
Loading…
Reference in New Issue
Block a user