Fix a migration wiping user info of users that don't have any mutes
And introduce safe_jsonb_set
This commit is contained in:
parent
724f611b0e
commit
39e996528c
5 changed files with 30 additions and 8 deletions
|
|
@ -727,7 +727,7 @@ defmodule Pleroma.User do
|
|||
set: [
|
||||
info:
|
||||
fragment(
|
||||
"jsonb_set(?, '{note_count}', ((?->>'note_count')::int + 1)::varchar::jsonb, true)",
|
||||
"safe_jsonb_set(?, '{note_count}', ((?->>'note_count')::int + 1)::varchar::jsonb, true)",
|
||||
u.info,
|
||||
u.info
|
||||
)
|
||||
|
|
@ -748,7 +748,7 @@ defmodule Pleroma.User do
|
|||
set: [
|
||||
info:
|
||||
fragment(
|
||||
"jsonb_set(?, '{note_count}', (greatest(0, (?->>'note_count')::int - 1))::varchar::jsonb, true)",
|
||||
"safe_jsonb_set(?, '{note_count}', (greatest(0, (?->>'note_count')::int - 1))::varchar::jsonb, true)",
|
||||
u.info,
|
||||
u.info
|
||||
)
|
||||
|
|
@ -818,7 +818,7 @@ defmodule Pleroma.User do
|
|||
set: [
|
||||
info:
|
||||
fragment(
|
||||
"jsonb_set(?, '{follower_count}', ?::varchar::jsonb, true)",
|
||||
"safe_jsonb_set(?, '{follower_count}', ?::varchar::jsonb, true)",
|
||||
u.info,
|
||||
s.count
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue