Add Translations
mix phx.gen.live Translations Translation translations \ lang:string title:string teaser:text content:map \ date:utc_datetime user_id:references:users \ public:boolean unauthorized:boolean article_id:references:articles
This commit is contained in:
22
priv/repo/migrations/20221226171313_create_translations.exs
Normal file
22
priv/repo/migrations/20221226171313_create_translations.exs
Normal file
@ -0,0 +1,22 @@
|
||||
defmodule Outlook.Repo.Migrations.CreateTranslations do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:translations) do
|
||||
add :lang, :string
|
||||
add :title, :string
|
||||
add :teaser, :text
|
||||
add :content, :map
|
||||
add :date, :utc_datetime
|
||||
add :public, :boolean, default: false, null: false
|
||||
add :unauthorized, :boolean, default: false, null: false
|
||||
add :user_id, references(:users, on_delete: :nothing)
|
||||
add :article_id, references(:articles, on_delete: :nothing)
|
||||
|
||||
timestamps()
|
||||
end
|
||||
|
||||
create index(:translations, [:user_id])
|
||||
create index(:translations, [:article_id])
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user