eduMFA icon indicating copy to clipboard operation
eduMFA copied to clipboard

fix: define sequence start and minvalue explicitly

Open Thaoden opened this issue 4 months ago • 4 comments

This addresses #733 The start value and min value of all sequences have been explicitly set to 1 to address a change in SQLAlchemy that affects MSSQL databases.

Thaoden avatar Aug 18 '25 12:08 Thaoden

Hi! We discuseed that internally and are a bit wondering if a migration would be required for existing deployments. Will check that in some test deployments and update you.

fritterhoff avatar Aug 23 '25 04:08 fritterhoff

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 92.86%. Comparing base (e00d31f) to head (e001abe). :warning: Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #734   +/-   ##
=======================================
  Coverage   92.86%   92.86%           
=======================================
  Files         192      192           
  Lines       25166    25166           
=======================================
  Hits        23370    23370           
  Misses       1796     1796           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

:rocket: New features to boost your workflow:
  • :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codecov[bot] avatar Aug 23 '25 04:08 codecov[bot]

So we discussed this longer last week. We would perfer a solution that only has impact on the mssql part.

In theory it should be possible to build sth like this and manipulate the sql string...

@compiles(CreateSequence, 'mssql')
def fix_start_offset(element, compiler, **kw):  # pragma: no cover
    text = compiler.visit_create_sequence(element, **kw)
    return text

fritterhoff avatar Sep 22 '25 12:09 fritterhoff

While I understand the desire to only impact the providers having an issue right now, I admittedly don't understand the separation here. For MSSQL, this fixes the bug, while for other providers, it merely makes the implicit default values explicit and hence doesn't break existing scenarios - which would be a benefit, in case the default values ever changed.

My own mastery of Python isn't good enough to implement the suggested SQL string manipluation.

Thaoden avatar Sep 24 '25 11:09 Thaoden