From: NEETzsche Date: Mon, 29 Nov 2021 18:08:09 +0000 (+0000) Subject: Force pinned_objects to be empty, not null X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=182c563ed0d461e7925a2556acaecb9a717f07ce;p=akkoma Force pinned_objects to be empty, not null --- diff --git a/priv/repo/migrations/20211125110126_force_pinned_objects_to_exist.exs b/priv/repo/migrations/20211125110126_force_pinned_objects_to_exist.exs new file mode 100644 index 000000000..1fe9271f0 --- /dev/null +++ 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