mirror of
https://framagit.org/framasoft/mobilizon.git
synced 2024-12-22 16:03:25 +00:00
489fd74545
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
19 lines
455 B
Elixir
19 lines
455 B
Elixir
defmodule Mobilizon.Storage.Repo.Migrations.FixRelayVisibility do
|
|
use Ecto.Migration
|
|
alias Mobilizon.Actors.Actor
|
|
alias Mobilizon.Storage.Repo
|
|
import Ecto.Query
|
|
|
|
def up do
|
|
Actor
|
|
|> where(preferred_username: "relay")
|
|
|> where(type: "Application")
|
|
|> where([a], is_nil(a.domain))
|
|
|> update(set: [visibility: "public"])
|
|
|> Repo.update_all([])
|
|
end
|
|
|
|
def down do
|
|
IO.puts("Not changing Relay visibility back")
|
|
end
|
|
end
|