From 8ad166e8e385b7baea79dc3949b438edba25c69f Mon Sep 17 00:00:00 2001 From: lain Date: Fri, 3 Jul 2020 12:46:28 +0200 Subject: [PATCH] Migrations: Add `accepts_chat_messages` to users. --- .../20200703101031_add_chat_acceptance_to_users.exs | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 priv/repo/migrations/20200703101031_add_chat_acceptance_to_users.exs 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 -- 2.45.2