Migrations: Add `accepts_chat_messages` to users.
[akkoma] / priv / repo / migrations / 20200703101031_add_chat_acceptance_to_users.exs
1 defmodule Pleroma.Repo.Migrations.AddChatAcceptanceToUsers do
2 use Ecto.Migration
3
4 def change do
5 alter table(:users) do
6 add(:accepts_chat_messages, :boolean, nullable: false, default: false)
7 end
8
9 # Looks stupid but makes the update much faster
10 execute("update users set accepts_chat_messages = local where local = true")
11 end
12 end