Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ReadThrough DB constraints #21

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

ReadThrough DB constraints #21

wants to merge 8 commits into from

Conversation

dato
Copy link
Owner

@dato dato commented Nov 13, 2023

  • Combine ReadThrough valid constraint checks into a single one
  • Add test for existing ReadThrough database constraints
  • Add missing constraints for read_status in ReadThrough

mouse-reeve and others added 8 commits July 3, 2022 12:22
Each readthrough should represent a unique instance of reading a book,
and so it should have a single status that represents that status of
that readthrough. This will be used to place the book on the appropriate
"shelves", and should allow for there to be a single active readthrough
if a book is in progress. That maeks the `is_active` field unnecessary.

Since the status of the readthrough is unambiguous, defining "finished
date" and "stopped date" separately is no longer necessary.

I've sketched out some database constraints but haven't implemented them
yet, because the conflicts might get gnarly and let's take this one step
at a time.

The migration logic is complex, so this is an untested draft and I'll
write unit tests for it in a subsequent commit.
Conflicts:
	bookwyrm/models/readthrough.py

Also changed dependencies of migration "0151_auto_20220703_1842":

  0150_readthrough_stopped_date -> 0184_auto_20231106_0421.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants