Update the Links model to have a unique shorten.
This commit is contained in:
@@ -5,8 +5,11 @@ defmodule LinkShortener.Repo.Migrations.CreateLinks do
|
||||
create table(:links) do
|
||||
add :name, :string
|
||||
add :url, :string
|
||||
add :shorten, :string
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create unique_index(:links, [:shorten])
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user