summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20190711042020_fix_and_secure_user_info_field.exs
blob: 9602a8c41b2d6cbfe7b147ddf6426c3d8769c0b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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