Closed bdr99 closed 6 years ago
looks good. you could write a data migration that pulls data out of yaml and into the new fields - or is there another plan for data loading?
@eshellman Our plan for data loading is to create a URL endpoint that takes in the information for a new or updated book (via an HTTP POST request) and adds it to the database. The backend component would post books to this URL endpoint as they are retrieved from the queuing system.
Plan sounds good. A data migration is probably not what you want. But an django management command that moves data from yaml to the new db fields could be useful. (the make_yaml management command is how the data got there in the first place)
We addressed this as part of https://github.com/gitenberg-dev/giten_site/pull/62, so this should be ready to be merged now.
OK, let me try this in my environment
I think you're trying to duplicate what the django ORM already does. Book.book_id is there to have a place to put the gutenberg book number, not to be the primary key for the book table.
This PR implements the new data model that we have designed for the website. There are separate tables for books, authors, covers, and external links. This will allow us to implement some of our planned features such as "Other Books By This Author".