2020-07-03 10:46:28 +00:00
|
|
|
defmodule Pleroma.Repo.Migrations.AddChatAcceptanceToUsers do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
2020-07-03 11:12:23 +00:00
|
|
|
def up do
|
2020-07-03 10:46:28 +00:00
|
|
|
alter table(:users) do
|
2020-07-03 11:12:23 +00:00
|
|
|
add(:accepts_chat_messages, :boolean, nullable: true)
|
2020-07-03 10:46:28 +00:00
|
|
|
end
|
|
|
|
|
2020-07-03 11:12:23 +00:00
|
|
|
execute("update users set accepts_chat_messages = true where local = true")
|
|
|
|
end
|
|
|
|
|
|
|
|
def down do
|
|
|
|
alter table(:users) do
|
|
|
|
remove(:accepts_chat_messages)
|
|
|
|
end
|
2020-07-03 10:46:28 +00:00
|
|
|
end
|
|
|
|
end
|