fix: correct community category migration rank
This commit is contained in:
@@ -124,12 +124,12 @@ INNER JOIN (
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY post_tag.`post_id`
|
||||
ORDER BY tag.`sort` DESC, post_tag.`id` ASC
|
||||
) AS row_number
|
||||
) AS `post_rank`
|
||||
FROM `la_community_post_tag` post_tag
|
||||
INNER JOIN `la_community_tag` tag ON tag.`id` = post_tag.`tag_id`
|
||||
INNER JOIN `la_community_post_category` category ON category.`id` = post_tag.`tag_id`
|
||||
) ranked
|
||||
WHERE ranked.row_number = 1
|
||||
WHERE ranked.`post_rank` = 1
|
||||
) selected_category ON selected_category.`post_id` = post.`id`
|
||||
SET post.`category_id` = selected_category.`category_id`
|
||||
WHERE post.`category_id` = 0;
|
||||
|
||||
Reference in New Issue
Block a user