diff options
author | Yorhel <git@yorhel.nl> | 2009-08-08 16:41:34 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2009-08-08 16:41:34 +0200 |
commit | 1e2a5c75f0154a12af7d19929153c27c75d193b1 (patch) | |
tree | d3a949969ef8ecc8d3c06f70238c8e5fe439e65f /util/updates | |
parent | c90e590bdbe7933df8e8a0d83c82dddfa22afc37 (diff) |
Converted threads_posts.date and edited to timestamptz
Everything still seems to be working fine so far.
Diffstat (limited to 'util/updates')
-rw-r--r-- | util/updates/update_2.6.sql | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/util/updates/update_2.6.sql b/util/updates/update_2.6.sql index 67482461..f3760d6a 100644 --- a/util/updates/update_2.6.sql +++ b/util/updates/update_2.6.sql @@ -59,6 +59,17 @@ ALTER TABLE wlists ALTER COLUMN added TYPE timestamptz USING to_timestamp(added) ALTER TABLE wlists ALTER COLUMN added SET DEFAULT NOW(); +-- threads_posts.date -> timestamptz +ALTER TABLE threads_posts ALTER COLUMN date DROP DEFAULT; +ALTER TABLE threads_posts ALTER COLUMN date TYPE timestamptz USING to_timestamp(date); +ALTER TABLE threads_posts ALTER COLUMN date SET DEFAULT NOW(); + +-- threads_posts.edited -> timestamptz + allow NULL +ALTER TABLE threads_posts ALTER COLUMN edited DROP NOT NULL; +ALTER TABLE threads_posts ALTER COLUMN edited DROP DEFAULT; +ALTER TABLE threads_posts ALTER COLUMN edited TYPE timestamptz USING CASE WHEN edited = 0 THEN NULL ELSE to_timestamp(edited) END; + + -- screenshots.status (smallint) -> screenshots.processed (boolean) ALTER TABLE screenshots RENAME COLUMN status TO processed; ALTER TABLE screenshots ALTER COLUMN processed DROP DEFAULT; |