Add additional sql check to ensure we don't pick up deleted articles when querying for missing articles

This commit is contained in:
Maurice Parker 2019-05-20 13:55:26 -05:00
parent 59ea5cadec
commit a5d6e5403e
1 changed files with 1 additions and 1 deletions

View File

@ -87,7 +87,7 @@ final class StatusesTable: DatabaseTable {
} }
func fetchArticleIDsForStatusesWithoutArticles() -> Set<String> { func fetchArticleIDsForStatusesWithoutArticles() -> Set<String> {
return fetchArticleIDs("select articleID from statuses s where userDeleted=0 and not exists (select 1 from articles a where a.articleID = s.articleID);") return fetchArticleIDs("select articleID from statuses s where (read=0 or starred=1) and userDeleted=0 and not exists (select 1 from articles a where a.articleID = s.articleID);")
} }
func fetchArticleIDs(_ sql: String) -> Set<String> { func fetchArticleIDs(_ sql: String) -> Set<String> {