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:
Thelonius Kort
2022-12-26 18:45:40 +01:00
parent f7f1e1a284
commit f66521dba8
13 changed files with 600 additions and 0 deletions

View 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