Skip to content

Conversation

@MaximeBICMTL
Copy link
Contributor

@MaximeBICMTL MaximeBICMTL commented Sep 21, 2025

Builds on #1303

Description

In the LORIS SQL schema, many boolean fields are actually represented as TINYINT(1) instead of BOOL. Until now, the LORIS-MRI Python ORM used these as BOOL fields, which is compatible with TINYINT(1) in MariaDB and MySQL. This PR improves the preciseness of the ORM by adding a decorator to accurately represent these "boolean integers" as integers in the SQL side, and booleans in the Python side.

Changelog

  • Add a IntBool ORM decorator.
  • Remove the special case in integration tests that handles boolean integers.
  • Update the ORM models with the new decorator.

@MaximeBICMTL MaximeBICMTL added Area: ORM Issue or PR related to the SQLAlchemy integration Complexity: Simple Issue or PR that should be simple to implement, review, or test labels Sep 21, 2025
Copy link
Contributor

@jeffersoncasimir jeffersoncasimir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved!

@MaximeBICMTL MaximeBICMTL changed the base branch from main to maxime_changes October 30, 2025 14:37
@MaximeBICMTL MaximeBICMTL force-pushed the add_int_bool_orm_decorator branch from 035437b to 3090285 Compare October 30, 2025 14:42
@MaximeBICMTL MaximeBICMTL force-pushed the add_int_bool_orm_decorator branch from 3090285 to b965bcf Compare October 30, 2025 14:43
@MaximeBICMTL MaximeBICMTL merged commit 8e0fad8 into aces:maxime_changes Oct 30, 2025
7 of 9 checks passed
MaximeBICMTL added a commit that referenced this pull request Oct 30, 2025
@cmadjar cmadjar added this to the 28.0.0 milestone Nov 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: ORM Issue or PR related to the SQLAlchemy integration Complexity: Simple Issue or PR that should be simple to implement, review, or test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants