logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: 182c563ed0d461e7925a2556acaecb9a717f07ce
parent c97f99ccf2a51c7f1078d7a20006deae2df3d12c
Author: NEETzsche <neetzsche@tutanota.com>
Date:   Mon, 29 Nov 2021 18:08:09 +0000

Force pinned_objects to be empty, not null

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