mobilizon/priv/repo/migrations/20210422155913_add_index_to_addresses.exs
Thomas Citharel 17a6a6eada
Add an unique index on addresses url
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2021-04-22 19:29:46 +02:00

12 lines
239 B
Elixir

defmodule Mobilizon.Storage.Repo.Migrations.AddIndexToAddresses do
use Ecto.Migration
def up do
create_if_not_exists(unique_index("addresses", [:url]))
end
def down do
drop_if_exists(index("addresses", [:url]))
end
end