Make the anonymous account id = -1
This change also simplifies the site index query.
This commit is contained in:
parent
03d4779129
commit
0ba9e22f70
|
@ -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',
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue