By Joroslav on Thursday, 17 May 2018
Posted in General Issues
Replies 3
Likes 0
Views 652
Votes 0
just the command DELETE FROM `w5w4j_discuss_posts` WHERE replied=0
or is it necessary to take the next steps?
Hi Joroslav,

It should be fine if the unanswered question do not have any integration with other component, where if you're integrate with any 3rd party eg: Jomsocial where the stream is already created in the Jomsocial (you need to delete the stream item that has been created or else the stream item will link to error page)
·
Thursday, 17 May 2018 09:36
·
0 Likes
·
0 Votes
·
0 Comments
·
I found out that this is not the case, and I will delete the answers.
How does the query look right?
·
Sunday, 20 May 2018 01:22
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey Joroslav,

What I think you should run first is to run a query to fetch all posts that aren't marked as resolved. Once you have the main parent post id, find all replies to that parent id.

1. Get all parent posts that are not marked as resolved:

[gist]
select * from #__discuss_posts where `answered`=0 and parent_id=0
[/gist]

2. Once you have all the id's, delete all replies to these posts, otherwise it would be an orphan

[gist]
delete from #__discuss_posts where `parent_id` IN (the id's from the first query)
[/gist]

3. Once you have deleted the replies, delete the parent posts

[gist]
delete from #__discuss_posts where `answered`=0 and `parent_id`=0;
[/gist]
·
Sunday, 20 May 2018 01:41
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post