Unique copies and pages in the database
This MR:
- Adds a read-only
Copy._exam_id
column. Updates automatically toCopy.submission.exam_id
. - Adds a unique constraint for
(Copy.number, Copy._exam_id)
. - Adds a unique constraint for
(Page.number, Page.copy_id)
. - Alters the scans pipeline to catch and handle failed unique constraints gracefully.
- Fixes the raw_scans pipeline to not commit an intermediate step, but flush instead.
- Adds a naming convention for constraints.
- Adds a migration for the changes above.
- Fixes a bug in migrations with newer metadata.
Closes #138 (closed)
Edited by Hugo Kerstens