akkoma/priv/repo/migrations/20200703101031_add_chat_acceptance_to_users.exs
lain 37fdb05058 User, Migration: Change accepts_chat_messages to be nullable
This is to model the ambiguous state of most users.
2020-07-03 13:12:23 +02:00

17 lines
375 B
Elixir

defmodule Pleroma.Repo.Migrations.AddChatAcceptanceToUsers do
use Ecto.Migration
def up do
alter table(:users) do
add(:accepts_chat_messages, :boolean, nullable: true)
end
execute("update users set accepts_chat_messages = true where local = true")
end
def down do
alter table(:users) do
remove(:accepts_chat_messages)
end
end
end