Resource icon

Prune all likes (queries)

GliX

Active member
GliX submitted a new resource:

Prune all likes (queries) - An example of SQL-queries to prune all likes.

Description: an example of SQL-queries to prune all likes.

Before you perform any action with the database, don't forget to backup!

Queries are executed sequentially:
PHP:
DELETE FROM xf_liked_content;
PHP:
UPDATE xf_user AS u
SET like_count = (
   SELECT COUNT(*)
   FROM xf_liked_content AS lc
   WHERE lc.content_user_id = u.user_id
   GROUP BY lc.content_user_id
);
PHP:
UPDATE xf_post SET likes = 0, like_users = 0x613a303a7b7d;

Read more about this resource...
 
Back
Top Bottom