From: href Date: Wed, 23 Jan 2019 10:22:31 +0000 (+0100) Subject: Flake: migrate pinned_activities in jsonb X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=e67bd93d9036770359da731b1ddad6f3da4fef66;p=akkoma Flake: migrate pinned_activities in jsonb --- diff --git a/priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs b/priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs index 69a27e0c8..70ec58cd2 100644 --- a/priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs +++ b/priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs @@ -37,6 +37,8 @@ defmodule Pleroma.Repo.Migrations.UsersAndActivitiesFlakeId do execute "ALTER TABLE activities ADD PRIMARY KEY (id);" execute "ALTER TABLE users ADD PRIMARY KEY (id);" + execute "UPDATE users SET info = jsonb_set(info, '{pinned_activities}', array_to_json(ARRAY(select jsonb_array_elements_text(info->'pinned_activities')))::jsonb);" + # Fkeys: # Activities - Referenced by: # TABLE "notifications" CONSTRAINT "notifications_activity_id_fkey" FOREIGN KEY (activity_id) REFERENCES activities(id) ON DELETE CASCADE