Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add column defaults to ORM models and tests #1204

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

maximemulder
Copy link
Contributor

@maximemulder maximemulder commented Oct 20, 2024

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.

@maximemulder maximemulder force-pushed the 2024-10-21_add-orm-defaults branch 5 times, most recently from 695e483 to 8ce962e Compare October 20, 2024 23:21
@maximemulder maximemulder added A-CI Area: CI. Issues and pull requests related to CI, including automated tests and static checks A-ORM Area: ORM. Issues and pull requests related to the SQLAlchemy integration S-Medium Size: Medium. Moderately-sized pull requests that are not too complex but not trivial either labels Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI Area: CI. Issues and pull requests related to CI, including automated tests and static checks A-ORM Area: ORM. Issues and pull requests related to the SQLAlchemy integration S-Medium Size: Medium. Moderately-sized pull requests that are not too complex but not trivial either
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant