Design the database schema #2

Open
opened 2026-08-23 11:11:23 +02:00 by gaetan · 0 comments
Owner

Part of #1

Question

Design the SQLite schema for the bookshelf app. We need tables for:

  • Book: id, isbn (nullable), title, authors (JSON array or separate table), cover_url, publisher, publish_date, total_pages, genres (JSON array), created_at, updated_at
  • UserBook (the user's relationship to a book): id, book_id, status (want_to_read/reading/read), current_page, rating (nullable), review (nullable), added_at, started_at, finished_at
  • Tag: id, name (unique), created_at
  • UserBookTag (junction table): user_book_id, tag_id

Consider:

  • Should authors be a separate table or stored as JSON?
  • Should genres be separate or JSON?
  • Index strategy for search/filter queries
  • Foreign key constraints

The schema should support: search by title/author, filter by status, sort by date added/started/finished/rating.

Part of #1 ## Question Design the SQLite schema for the bookshelf app. We need tables for: - **Book**: id, isbn (nullable), title, authors (JSON array or separate table), cover_url, publisher, publish_date, total_pages, genres (JSON array), created_at, updated_at - **UserBook** (the user's relationship to a book): id, book_id, status (want_to_read/reading/read), current_page, rating (nullable), review (nullable), added_at, started_at, finished_at - **Tag**: id, name (unique), created_at - **UserBookTag** (junction table): user_book_id, tag_id Consider: - Should authors be a separate table or stored as JSON? - Should genres be separate or JSON? - Index strategy for search/filter queries - Foreign key constraints The schema should support: search by title/author, filter by status, sort by date added/started/finished/rating.
gaetan self-assigned this 2026-08-23 11:21:34 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
gaetan/Argus#2
No description provided.