Commit 8ad75f9e authored by lain's avatar lain

Migrations: Add migration to fill empty info fields and make them non-null.

parent a43b899e
defmodule Pleroma.Repo.Migrations.FixAndSecureUserInfoField do
use Ecto.Migration
def up do
execute("UPDATE users SET info = '{}'::jsonb WHERE info IS NULL")
execute("ALTER TABLE users
ALTER COLUMN info SET NOT NULL
")
end
def down do
execute("ALTER TABLE users
ALTER COLUMN info DROP NOT NULL
")
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment