From 042d09b8cbbe295eeaf5fe58576429313c1c050c Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Fri, 30 Jul 2021 17:23:03 +0200 Subject: [PATCH] Put unique index on participants urls Signed-off-by: Thomas Citharel --- ...30143924_put_unique_index_on_participants_urls.exs | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 priv/repo/migrations/20210730143924_put_unique_index_on_participants_urls.exs diff --git a/priv/repo/migrations/20210730143924_put_unique_index_on_participants_urls.exs b/priv/repo/migrations/20210730143924_put_unique_index_on_participants_urls.exs new file mode 100644 index 000000000..2fc09c1b3 --- /dev/null +++ b/priv/repo/migrations/20210730143924_put_unique_index_on_participants_urls.exs @@ -0,0 +1,11 @@ +defmodule Mobilizon.Storage.Repo.Migrations.PutUniqueIndexOnParticipantsUrls do + use Ecto.Migration + + def up do + create_if_not_exists(unique_index("participants", [:url])) + end + + def down do + drop_if_exists(index("participants", [:url])) + end +end