aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--apioforum/db.py4
-rw-r--r--apioforum/forum.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/apioforum/db.py b/apioforum/db.py
index 7f15950..ee197c6 100644
--- a/apioforum/db.py
+++ b/apioforum/db.py
@@ -250,6 +250,10 @@ DROP VIEW most_recent_posts;
CREATE VIEW most_recent_posts AS
SELECT max(id), * FROM posts WHERE deleted = 0 GROUP BY thread;
""",
+"""
+DROP VIEW public_posts;
+DROP VIEW public_forums;
+""",
]
diff --git a/apioforum/forum.py b/apioforum/forum.py
index 3abe839..f1fae28 100644
--- a/apioforum/forum.py
+++ b/apioforum/forum.py
@@ -550,8 +550,7 @@ def search():
FROM posts_fts
JOIN posts ON posts_fts.rowid = posts.id
JOIN threads ON threads.id = posts.thread
- JOIN public_posts ON public_posts.id = posts.id
- WHERE posts_fts MATCH ? AND public_posts.public
+ WHERE posts_fts MATCH ?
ORDER BY rank
LIMIT 50
""", (query,)).fetchall()