From e67bd93d9036770359da731b1ddad6f3da4fef66 Mon Sep 17 00:00:00 2001 From: href Date: Wed, 23 Jan 2019 11:22:31 +0100 Subject: [PATCH] Flake: migrate pinned_activities in jsonb --- .../migrations/20181218172826_users_and_activities_flake_id.exs | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.45.2