forked from potsda.mn/mobilizon
4f530cabcf
Deleting an actor should not remove the reports Signed-off-by: Thomas Citharel <tcit@tcit.fr>
25 lines
562 B
Elixir
25 lines
562 B
Elixir
defmodule Mobilizon.Storage.Repo.Migrations.AddInstanceMaterializedView do
|
|
use Ecto.Migration
|
|
alias Mobilizon.Storage.Views.Instances
|
|
|
|
def up do
|
|
execute(Instances.create_materialized_view())
|
|
|
|
execute(Instances.refresh_instances())
|
|
|
|
execute(Instances.drop_trigger())
|
|
|
|
execute(Instances.create_trigger())
|
|
|
|
create_if_not_exists(unique_index("instances", [:domain]))
|
|
end
|
|
|
|
def down do
|
|
drop_if_exists(unique_index("instances", [:domain]))
|
|
|
|
execute(Instances.drop_refresh_instances())
|
|
|
|
execute(Instances.drop_view())
|
|
end
|
|
end
|