update relations

This commit is contained in:
Daniel Yrovas 2025-01-10 21:52:22 +11:00
parent 90414e6b93
commit 4ad3973e9b
Signed by: danielyrovas
SSH key fingerprint: SHA256:1avlGZQpGW038lBkNI5lOS7f0hIPM7ecJen2/P1MCCU
6 changed files with 14 additions and 7 deletions

View file

@ -9,6 +9,8 @@ defmodule Wild.Accounts.User do
field :current_password, :string, virtual: true, redact: true
field :confirmed_at, :utc_datetime
has_many :book_reads, Wild.BookReads.BookRead
timestamps(type: :utc_datetime)
end

View file

@ -9,8 +9,9 @@ defmodule Wild.BookReads.BookRead do
field :thoughts, :string
field :read_start, :utc_datetime
field :read_finish, :utc_datetime
field :user_id, :id, primary_key: true
field :book_id, :id, primary_key: true
belongs_to :user, Wild.Accounts.User, type: :id, primary_key: true
belongs_to :book, Wild.Books.Book, type: :id, primary_key: true
timestamps(type: :utc_datetime)
end

View file

@ -9,6 +9,8 @@ defmodule Wild.Books.Author do
field :year_born, :string
field :year_died, :string
has_many :books, Wild.Books.Book
timestamps(type: :utc_datetime)
end

View file

@ -6,7 +6,9 @@ defmodule Wild.Books.Book do
field :title, :string
field :blurb, :string
field :publication_year, :string
field :author_id, :id
belongs_to :author, Wild.Books.Author
# field :author_id, :id
timestamps(type: :utc_datetime)
end

View file

@ -4,7 +4,7 @@
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="csrf-token" content={get_csrf_token()} />
<.live_title default="Wild" suffix=" · Phoenix Framework">
<.live_title default="Call of the Wild" suffix="">
{assigns[:page_title]}
</.live_title>
<link phx-track-static rel="stylesheet" href={~p"/assets/app.css"} />