aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-07-03 12:46:28 +0200
committerlain <lain@soykaf.club>2020-07-03 12:46:28 +0200
commit8ad166e8e385b7baea79dc3949b438edba25c69f (patch)
treecc523c451e9a32c17937924de4e3ad9ec67cffd7
parentfd5ad99aceb235775b6ded661c42fa4f195e7bfe (diff)
downloadpleroma-8ad166e8e385b7baea79dc3949b438edba25c69f.tar.gz
Migrations: Add `accepts_chat_messages` to users.
-rw-r--r--priv/repo/migrations/20200703101031_add_chat_acceptance_to_users.exs12
1 files changed, 12 insertions, 0 deletions
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