From: lain Date: Fri, 3 Jul 2020 10:46:28 +0000 (+0200) Subject: Migrations: Add `accepts_chat_messages` to users. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=8ad166e8e385b7baea79dc3949b438edba25c69f;p=akkoma Migrations: Add `accepts_chat_messages` to users. --- diff --git a/priv/repo/migrations/20200703101031_add_chat_acceptance_to_users.exs b/priv/repo/migrations/20200703101031_add_chat_acceptance_to_users.exs new file mode 100644 index 000000000..4ae3c4201 --- /dev/null +++ b/priv/repo/migrations/20200703101031_add_chat_acceptance_to_users.exs @@ -0,0 +1,12 @@ +defmodule Pleroma.Repo.Migrations.AddChatAcceptanceToUsers do + use Ecto.Migration + + def change do + alter table(:users) do + add(:accepts_chat_messages, :boolean, nullable: false, default: false) + end + + # Looks stupid but makes the update much faster + execute("update users set accepts_chat_messages = local where local = true") + end +end