2022-02-25 23:11:42 -07:00
|
|
|
# Pleroma: A lightweight social networking server
|
2023-01-02 13:38:50 -07:00
|
|
|
# Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
|
2022-02-25 23:11:42 -07:00
|
|
|
# SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2020-07-03 04:46:28 -06:00
|
|
|
defmodule Pleroma.Repo.Migrations.AddChatAcceptanceToUsers do
|
|
|
|
use Ecto.Migration
|
|
|
|
|
2020-07-03 05:12:23 -06:00
|
|
|
def up do
|
2020-07-03 04:46:28 -06:00
|
|
|
alter table(:users) do
|
2020-07-03 05:12:23 -06:00
|
|
|
add(:accepts_chat_messages, :boolean, nullable: true)
|
2020-07-03 04:46:28 -06:00
|
|
|
end
|
|
|
|
|
2020-07-03 05:12:23 -06: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 04:46:28 -06:00
|
|
|
end
|
|
|
|
end
|