Skip to content
This repository has been archived by the owner on Oct 10, 2024. It is now read-only.

Add integrity constraints to database models #355

Open
TimJentzsch opened this issue Feb 7, 2022 · 0 comments
Open

Add integrity constraints to database models #355

TimJentzsch opened this issue Feb 7, 2022 · 0 comments
Labels
API Suggestion which would change the user-facing API enhancement New feature or request

Comments

@TimJentzsch
Copy link
Contributor

TimJentzsch commented Feb 7, 2022

We have a couple of constraints that should always hold.
I'm not sure if it's possible to encode these in Django, but if it is, it would help to keep our data clean and potentially speed up some queries.

Note that we might need to fix some faulty data if we integrate this.

Some constraints that I can think of at the top of my head:

Submission:

  • If claimed_by is not null, then claim_time is not null
  • If completed_by is not null, then complete_time is not null
  • If completed_by is not null, then claimed_by is not null
  • create_time <= claim_time <= complete_time
  • If removed_from_queue is true, then approved is false
  • If approved is true then removed_from_queue is false
@TimJentzsch TimJentzsch added enhancement New feature or request API Suggestion which would change the user-facing API labels Feb 7, 2022
@TimJentzsch TimJentzsch changed the title Add integrety constraints to database models Add integrity constraints to database models Feb 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
API Suggestion which would change the user-facing API enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant