mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-22 19:01:32 +00:00
Fix not-equals check in post aggregates update trigger (#4837)
* Fix not-equals check in post aggregates update trigger Should fix #4836 * Create up.sql * Create down.sql * Update down.sql
This commit is contained in:
parent
f080400826
commit
42a6d8ab0f
3 changed files with 15 additions and 1 deletions
|
@ -486,7 +486,7 @@ BEGIN
|
|||
INNER JOIN old_post ON old_post.id = new_post.id
|
||||
AND (old_post.featured_community,
|
||||
old_post.featured_local) != (new_post.featured_community,
|
||||
old_post.featured_local)
|
||||
new_post.featured_local)
|
||||
WHERE
|
||||
post_aggregates.post_id = new_post.id;
|
||||
RETURN NULL;
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
SELECT
|
||||
;
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
-- Fix rows that were not updated because of the old incorrect trigger
|
||||
UPDATE
|
||||
post_aggregates
|
||||
SET
|
||||
featured_local = post.featured_local
|
||||
FROM
|
||||
post
|
||||
WHERE
|
||||
post.id = post_aggregates.post_id
|
||||
AND post.featured_local != post_aggregates.featured_local;
|
||||
|
Loading…
Reference in a new issue