initial book review schema
This commit is contained in:
parent
e218290e08
commit
90414e6b93
15 changed files with 653 additions and 0 deletions
20
priv/repo/migrations/20250109103126_create_book_reads.exs
Normal file
20
priv/repo/migrations/20250109103126_create_book_reads.exs
Normal file
|
@ -0,0 +1,20 @@
|
|||
defmodule Wild.Repo.Migrations.CreateBookReads do
|
||||
use Ecto.Migration
|
||||
|
||||
def change do
|
||||
create table(:book_reads) do
|
||||
add :rating, :integer
|
||||
add :thoughts, :string
|
||||
add :read_start, :utc_datetime
|
||||
add :read_finish, :utc_datetime
|
||||
add :progress, :integer
|
||||
add :user_id, references(:users, on_delete: :nothing)
|
||||
add :book_id, references(:books, on_delete: :nothing)
|
||||
|
||||
timestamps(type: :utc_datetime)
|
||||
end
|
||||
|
||||
create index(:book_reads, [:user_id])
|
||||
create index(:book_reads, [:book_id])
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue