logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: d486d7d09ed9dda6dd643ec62c41857c182fb7a9
parent c97f99ccf2a51c7f1078d7a20006deae2df3d12c
Author: lain <lain@soykaf.club>
Date:   Mon, 29 Nov 2021 18:08:10 +0000

Merge branch 'force_pinned_objects_to_be_empty' into 'develop'

Force pinned_objects to be empty, not null

Closes #2788

See merge request pleroma/pleroma!3548

Diffstat:

Apriv/repo/migrations/20211125110126_force_pinned_objects_to_exist.exs11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/priv/repo/migrations/20211125110126_force_pinned_objects_to_exist.exs b/priv/repo/migrations/20211125110126_force_pinned_objects_to_exist.exs @@ -0,0 +1,11 @@ +defmodule Pleroma.Repo.Migrations.ForcePinnedObjectsToExist do + use Ecto.Migration + + def change do + execute("UPDATE users SET pinned_objects = '{}' WHERE pinned_objects IS NULL") + + alter table("users") do + modify(:pinned_objects, :map, null: false, default: %{}) + end + end +end