From 4bef3d8964d5872ce2a243945998073a71eeac3a Mon Sep 17 00:00:00 2001 From: Jeff Becker Date: Fri, 9 Mar 2018 08:10:57 -0500 Subject: [PATCH] fix --- contrib/backends/srndv2/src/srnd/postgres.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/backends/srndv2/src/srnd/postgres.go b/contrib/backends/srndv2/src/srnd/postgres.go index 3704e54..ad05897 100644 --- a/contrib/backends/srndv2/src/srnd/postgres.go +++ b/contrib/backends/srndv2/src/srnd/postgres.go @@ -169,7 +169,7 @@ func (self *PostgresDatabase) prepareStatements() { DeleteArticle_5: "DELETE FROM ArticleAttachments WHERE message_id = $1", DeleteThread: "DELETE FROM ArticleThreads WHERE root_message_id = $1", DeleteArticleV8: "DELETE FROM ArticlePosts WHERE message_id = $1", - DeleteThreadV8: "DELETE FROM ArticlePosts WHERE root_message_id = $1 OR message_id = $1", + DeleteThreadV8: "DELETE FROM ArticlePosts WHERE ref_id = $1 OR message_id = $1", GetThreadReplyPostModels_1: "SELECT newsgroup, message_id, ref_id, name, subject, path, time_posted, message, addr FROM ArticlePosts WHERE message_id IN ( SELECT message_id FROM ArticlePosts WHERE ref_id = $1 ORDER BY time_posted DESC LIMIT $2 ) ORDER BY time_posted ASC", GetThreadReplyPostModels_2: "SELECT newsgroup, message_id, ref_id, name, subject, path, time_posted, message, addr FROM ArticlePosts WHERE message_id IN ( SELECT message_id FROM ArticlePosts WHERE ref_id = $1 ) ORDER BY time_posted ASC", GetThreadReplies_1: "SELECT message_id FROM ArticlePosts WHERE message_id IN ( SELECT message_id FROM ArticlePosts WHERE ref_id = $1 ORDER BY time_posted DESC LIMIT $2 ) ORDER BY time_posted ASC", @@ -181,7 +181,7 @@ func (self *PostgresDatabase) prepareStatements() { HasArticle: "SELECT 1 FROM Articles WHERE message_id = $1", HasArticleLocal: "SELECT 1 FROM ArticlePosts WHERE message_id = $1", GetPostAttachments: "SELECT filepath FROM ArticleAttachments WHERE message_id = $1", - GetThreadAttachments: "SELECT filepath FROM ArticleAttachments WHERE message_id IN ( SELECT message_id FROM ArticlePosts WHERE root_message_id = $1 OR message_id = $1)", + GetThreadAttachments: "SELECT filepath FROM ArticleAttachments WHERE message_id IN ( SELECT message_id FROM ArticlePosts WHERE ref_id = $1 OR message_id = $1)", GetPostAttachmentModels: "SELECT filepath, filename FROM ArticleAttachments WHERE message_id = $1", RegisterArticle_1: "INSERT INTO Articles (message_id, message_id_hash, message_newsgroup, time_obtained, message_ref_id) VALUES($1, $2, $3, $4, $5)", RegisterArticle_2: "UPDATE Newsgroups SET last_post = $1 WHERE name = $2",