Closed Soyokaze-42 closed 9 months ago
@kenancasey I'm looking at this schema change and removing PrayerUserCard. Since we have a many-to-many relationship between the UserCard and the PrayerDeck, I have to use a table. You called this an association table. Django calls it a "through" model. Instead of creating the association table and the userCardLog table, why don't we just rename the PrayerUserCard PrayerDeckUserCard and replace used with the timestamp field for when it was prayed?
Let's go that route since it gives us the bonus of the timestamp (metrics, etc.) we were talking about!
But we still need that UserCardPrayed
table to record all the prayers to record all the stats.
Not if we store the date prayed in the PrayerDeckUserCard table. That would have all the same information plus the PrayerDeck. We just have to keep the PrayerDecks and the PrayerDeckUserCards.
Sorry. I've forgotten the structure of those tables. Can you remind me what fields each one contains?
Here is the new one.
And the old one from the repo:
While looking at this, I assumed we would want to keep the prayerdecks around for the same historical reasons we are keeping the log of CardsPrayed. If we will only have one PrayerDeck at any given time, we do not need the PrayerDeckUserCard table (besides the history we would be storing there).
I just submitted a PR for this. Yay for schema!
rename Prayer PrayerDeck Add last_prayed date remove PrayerUserCard replace prayerusercard with usercard in PrayerDeck add UserCardPrayed table with usercard, date_prayed remove use_count and adjustment from usercard