Add column defaults to ORM models and tests #1204
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Week-end PR because I want to take some afternoon off next week.
This PR adds default values to the ORM models of LORIS-MRI, which allows to type check the ORM constructors by knowing which fields are required or not (this was the only hole in ORM typing currently).
The PR also update the ORM-SQL integration test to ensure that these defaults match those of the SQL definitions of LORIS main. Some of the defaults of our SQL schema look quite suspicious and should be removed IMO, but this is something that should be treated in LORIS main first if we want to fix it.
The first commit updates the SQL schema (and minor formatting that I was too lazy to add in a separate PR).
The second commit adds a SQLAlchemy decorator (I refuse to write
"true"
or"false"
in my code !).The third commit adds the defaults, which are checked by the previous integration tests.