pdf-quiz-generator/backend/app
Daniel c94640c890 CRITICAL: Remove cascade delete from Section→Quiz relationship
Root cause of lost PREP 2016 quiz: deleting a section (e.g. to recreate
with different page ranges) cascade-deleted ALL quizzes attached to it,
destroying the quiz AND all its questions permanently.

Fixes:
- Section.quizzes relationship: removed cascade="all, delete-orphan"
  Deleting a section no longer touches quizzes at all
- Quiz.section_id FK: changed to ON DELETE SET NULL, nullable=True
  If a section is deleted, quizzes keep working (section_id becomes null)
- DB migration: drops old FK constraint and recreates with SET NULL

Also answers the question about deleting a bank question in a quiz:
- quiz_question_links FK has ON DELETE CASCADE — deleting a question
  silently removes it from all quizzes
- This needs a warning UI (not yet implemented — no delete button in bank)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 18:26:22 +02:00
..
models CRITICAL: Remove cascade delete from Section→Quiz relationship 2026-04-01 18:26:22 +02:00
routers Fix mobile touch, hide docs for users, timer save/restore, Nextcloud server-side 2026-04-01 17:39:43 +02:00
schemas Add extraction modes; fix resume; hide Nextcloud/Upload for users; delete PREP 2013 questions 2026-04-01 12:43:24 +02:00
services Explanation: capture ALL content verbatim until next question 2026-04-01 13:16:43 +02:00
tasks Fix jobs showing double: lpush was in both router AND Celery task 2026-04-01 18:00:20 +02:00
utils Junction table for shared questions; verification blocking; semantic bank search; bug fixes 2026-04-01 00:55:13 +02:00
__init__.py Initial commit: PDF Quiz Generator app 2026-03-30 20:04:53 +00:00
config.py Major platform update: pgvector search, multi-provider TTS, settings page, CLI 2026-03-31 18:03:10 +02:00
database.py Major platform update: pgvector search, multi-provider TTS, settings page, CLI 2026-03-31 18:03:10 +02:00
main.py CRITICAL: Remove cascade delete from Section→Quiz relationship 2026-04-01 18:26:22 +02:00