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 ( INSERT OR IGNORE INTO authors (
id,
name, name,
salt, salt,
passhash, passhash,
joindate, joindate,
biography biography
) VALUES ( ) VALUES (
-1,
'anonymous', 'anonymous',
'', '',
'', '',

View File

@ -9,17 +9,6 @@ FROM
authors authors
WHERE WHERE
posts.authorid = authors.id 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 ORDER BY
posts.post_time DESC posts.post_time DESC
LIMIT 10; LIMIT 10;