1
0
Fork 0
mirror of https://framagit.org/framasoft/mobilizon.git synced 2024-12-22 16:03:25 +00:00
mobilizon/priv/repo/migrations/20210622133555_add_index_to_posts.exs
Thomas Citharel 7bb8568504
Add an unique index on posts URLs
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
2021-06-22 16:51:21 +02:00

11 lines
227 B
Elixir

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