Add an unique index on posts URLs
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
11
priv/repo/migrations/20210622133555_add_index_to_posts.exs
Normal file
11
priv/repo/migrations/20210622133555_add_index_to_posts.exs
Normal file
@@ -0,0 +1,11 @@
|
||||
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
|
||||
Reference in New Issue
Block a user