The tables created for progress syncing have foreign key references to other tables (`books` and `user`). If foreign key constraints are enabled when connecting to the database (as is so in Calibre Desktop), deleting a book or user will fail unless the referencing child rows in the progress syncing tables have also been deleted.
One way to achieve this is to create the progress syncing tables, `book_format_checksums` and `kosync_progress`, with the `ON DELETE CASCADE` clause added to the foreign key reference. This will automatically delete child rows in these tables when their corresponding parent row in in `books` or `user` is deleted. In other words, book checksums and user sync progress will be deleted when the corresponding book or user is deleted.
Fixes: #842