16 lines
362 B
Elixir
16 lines
362 B
Elixir
defmodule Wild.Repo.Migrations.CreateBooks do
|
|
use Ecto.Migration
|
|
|
|
def change do
|
|
create table(:books) do
|
|
add :title, :string
|
|
add :blurb, :string
|
|
add :publication_year, :string
|
|
add :author_id, references(:authors, on_delete: :nothing)
|
|
|
|
timestamps(type: :utc_datetime)
|
|
end
|
|
|
|
create index(:books, [:author_id])
|
|
end
|
|
end
|