Add unique constraint to Translation
To make sure only one translation per article is possible.
This commit is contained in:
@ -0,0 +1,7 @@
|
||||
defmodule Outlook.Repo.Migrations.AddLangArticleIdUniqueIndexToTranslations do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create unique_index(:translations, [:article_id, :lang], name: :article_id_lang_unique_index)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user