projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a92c43b
)
Flake: migrate pinned_activities in jsonb
author
href
<href@random.sh>
Wed, 23 Jan 2019 10:22:31 +0000
(11:22 +0100)
committer
href
<href@random.sh>
Wed, 23 Jan 2019 10:26:39 +0000
(11:26 +0100)
priv/repo/migrations/20181218172826_users_and_activities_flake_id.exs
patch
|
blob
|
history
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 69a27e0c8776566809d96ed85cb4b2090c279099..70ec58cd23980b593eeae8c5c16453d114c22c53 100644
(file)
--- 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