From 2d64ada080131cbd689149a266bb34c428c5c9ce Mon Sep 17 00:00:00 2001 From: rebecca Date: Mon, 2 Nov 2026 19:30:44 +0000 Subject: fix issue with missing revision timestamps for old posts that had never been edited --- apioforum/db.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apioforum/db.py b/apioforum/db.py index 024aae9..ad34af3 100644 --- a/apioforum/db.py +++ b/apioforum/db.py @@ -270,7 +270,7 @@ CREATE TABLE revisions ( id INTEGER PRIMARY KEY, author NOT NULL REFERENCES users(username), content TEXT NOT NULL, - time TIMESTAMP, + time TIMESTAMP NOT NULL, comment TEXT ); CREATE TABLE wiki_pages ( @@ -284,7 +284,7 @@ ALTER TABLE role_config ADD COLUMN p_edit_wiki INT NOT NULL DEFAULT 1 """, """ INSERT INTO revisions (post, author, content, time) - SELECT id, author, content, updated FROM posts; + SELECT id, author, content, coalesce(updated,created) FROM posts; """, ] -- cgit v1.2.3