Update the Links model to have a unique shorten.

This commit is contained in:
2023-07-06 19:59:30 +03:00
parent ebef9bdbaa
commit c17b323566
3 changed files with 9 additions and 2 deletions
@@ -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