User: Move inbox & shared_inbox to own fields

This commit is contained in:
Haelwenn (lanodan) Monnier 2020-04-01 07:47:07 +02:00
commit 62656ab259
No known key found for this signature in database
GPG key ID: D5B7A8E43C997DEE
6 changed files with 70 additions and 46 deletions

View file

@ -0,0 +1,20 @@
defmodule Pleroma.Repo.Migrations.UsersAddInboxes do
use Ecto.Migration
def up do
alter table(:users) do
add_if_not_exists(:inbox, :text)
add_if_not_exists(:shared_inbox, :text)
end
execute("UPDATE users SET inbox = source_data->>'inbox'")
execute("UPDATE users SET shared_inbox = source_data->'endpoints'->>'sharedInbox'")
end
def down do
alter table(:users) do
remove_if_exists(:inbox, :text)
remove_if_exists(:shared_inbox, :text)
end
end
end