如果不在“bookmarks”表中,书签存储在哪张表中?

我想查看每个人的书签。因此,我在数据浏览器中尝试了这个简单的查询。

SELECT * from bookmarks

但该查询未返回任何结果。我添加了自己的书签并再次运行查询,仍然没有结果。如果书签不存储在 bookmarks 表中,它们存储在哪里?

2 个赞

Try running

SELECT COUNT(id) FROM bookmarks 
1 个赞

image
image
One of my bookmarks. I’m sure others have bookmarks also:
image

1 个赞

Sorry, I’m at a loss for what the problem might be. That makes no sense to me at all. I would think you would get some kind of error message or at least the 1 you know exists.

1 个赞

The bookmarks table doesn’t seem to be getting used yet. It is part of some improvements that are being made to Discourse’s bookmarking functionality.

Currenty, you can get information about bookmarks with a query like this:

SELECT
t.user_id,
t.id AS topic_id,
COUNT(*) AS bookmark_count
FROM post_actions pa
JOIN posts p
ON p.id = pa.post_id
JOIN topics t
ON t.id = p.topic_id
WHERE pa.post_action_type_id = 1
AND t.deleted_at IS NULL
AND p.deleted_at IS NULL
GROUP BY t.id, t.user_id
ORDER BY bookmark_count DESC
LIMIT 20
7 个赞

:information_source: 书签现在可以在 bookmark 表中找到。