Delete options and responses together with their poll
CI / Deploy / test (push) Successful in 53s
CI / Deploy / deploy (push) Skipped

Deleting a poll removed its slides with a plain deleteAll and relied on
ON DELETE CASCADE for slide options and responses. SQLite does not enforce
foreign keys by default, so answers of deleted polls stayed in the database.
Cascade through the ORM instead and remove the rows left behind earlier.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
gnilebeinandClaude Opus 5.5 committed 2026-11-08 21:56:18 +01:00
1 parent 8b0e82d806
commit 0a4c9fad09
4 files changed
+71 -1

No files matched your search

+3
View File
@@ -237,6 +237,9 @@ Kein WebSocket: Presenter (`/admin/{token}/state`) und Teilnehmende (`/p/{code}/
- Einrückung 4 Spaces, LF (siehe `.editorconfig`).
- Keine neuen Frontend-Abhängigkeiten / kein Build-Schritt ohne Rücksprache.
- Schemaänderungen nur per neuer Migration, nie bestehende Migration ändern (sobald deployed).
- Beim Löschen nie auf `ON DELETE CASCADE` verlassen: SQLite setzt Fremdschlüssel ohne `PRAGMA foreign_keys = ON`
nicht durch (die Test-Suite schaltet sie aber ein, Fehler fallen dort also nicht auf). Abhängige Daten über
`dependent` + `cascadeCallbacks` im ORM löschen (z. B. Polls → Slides → SlideOptions/Responses).
- Commits klein und thematisch; Commit-Messages auf Englisch im Imperativ.
- **`main` ist geschützt:** nie direkt auf `main` committen oder pushen. Jede Änderung auf einem
eigenen Branch (z. B. `feature/…`, `fix/…`, `docs/…`), pushen und per Pull Request in Gitea mergen.