summaryrefslogtreecommitdiff
path: root/util/updates/update_2.6.sql
diff options
context:
space:
mode:
Diffstat (limited to 'util/updates/update_2.6.sql')
-rw-r--r--util/updates/update_2.6.sql11
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;