Make the anonymous account id = -1

This change also simplifies the site index query.
This commit is contained in:
Robin Malley 2020-05-19 20:14:22 -04:00
parent 03d4779129
commit 0ba9e22f70
2 changed files with 2 additions and 11 deletions

View File

@ -1,10 +1,12 @@
INSERT OR IGNORE INTO authors (
id,
name,
salt,
passhash,
joindate,
biography
) VALUES (
-1,
'anonymous',
'',
'',

View File

@ -9,17 +9,6 @@ FROM
authors
WHERE
posts.authorid = authors.id
UNION
SELECT
posts.id,
posts.post_title,
posts.isanon,
posts.post_time,
'Anonymous'
FROM
posts
WHERE
posts.authorid = -1
ORDER BY
posts.post_time DESC
LIMIT 10;