Move local keys out of user.info
This commit is contained in:
parent
9e34919dcd
commit
fefbd31c6e
8 changed files with 33 additions and 14 deletions
9
priv/repo/migrations/20191006123824_add_keys_column.exs
Normal file
9
priv/repo/migrations/20191006123824_add_keys_column.exs
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
defmodule Pleroma.Repo.Migrations.AddKeysColumn do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
alter table("users") do
|
||||
add_if_not_exists :keys, :text
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
defmodule Pleroma.Repo.Migrations.MoveKeysToSeparateColumn do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
execute("update users set keys = info->>'keys' where local", "update users set info = jsonb_set(info, '{keys}'::text[], to_jsonb(keys)) where local")
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue