Files
phoenix-ausblick/priv/repo/migrations/20221226171313_create_translations.exs
Thelonius Kort f66521dba8 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
2022-12-26 18:45:40 +01:00

23 lines
637 B
Elixir

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