aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrebecca <ubq323@ubq323.website>2026-11-02 19:30:44 +0000
committerrebecca <ubq323@ubq323.website>2026-11-02 19:30:44 +0000
commit2d64ada080131cbd689149a266bb34c428c5c9ce (patch)
treef2b65f5ef5bac920f12fdca5e887b074843b50ab
parent0f804018539c472f7fc19af88a141560c404d9ec (diff)
fix issue with missing revision timestamps for old posts that had never been edited
-rw-r--r--apioforum/db.py4
1 files 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;
""",
]