initial book review schema
This commit is contained in:
parent
e218290e08
commit
90414e6b93
15 changed files with 653 additions and 0 deletions
16
priv/repo/migrations/20250109091420_create_books.exs
Normal file
16
priv/repo/migrations/20250109091420_create_books.exs
Normal file
|
@ -0,0 +1,16 @@
|
|||
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
|
Loading…
Add table
Add a link
Reference in a new issue