Cascade-delete progress updates

Add a warning about it, and update test to confirm it works
This commit is contained in:
Joel Bradshaw
2021-01-19 22:30:51 -08:00
parent 60b42827f4
commit 32346cf9a3
4 changed files with 18 additions and 6 deletions

View File

@ -42,7 +42,7 @@ class ReadThrough(BookWyrmModel):
class ProgressUpdate(BookWyrmModel):
''' Store progress through a book in the database. '''
user = models.ForeignKey('User', on_delete=models.PROTECT)
readthrough = models.ForeignKey('ReadThrough', on_delete=models.PROTECT)
readthrough = models.ForeignKey('ReadThrough', on_delete=models.CASCADE)
progress = models.IntegerField()
mode = models.CharField(
max_length=3,