Skip to content

Conversation

@arthanson
Copy link
Contributor

@arthanson arthanson commented Dec 17, 2025

Fixes: #338

Reworked the init logic. The call_command to migration check has side-effects when running migrations and migration checks so had to be removed.

  • combined the separate check functions into one routine
  • instead of checking sys.argv for migration added migration signal handlers
  • removed exception handlers around the transaction-atomics as the _should_skip_dynamic_model_creation will have already checked if in tests and bypassed this, so all exceptions should be raised.
  • however, unfortunately need a check to make sure the last migration was run '0003_ensure_fk_constraints' any updates to the main model (that would cause a field does not exist error) when using custom object type would need the migration name replaced here in the future.

Tested running:

  • Tests
  • migrations from empty DB
  • migrations from in-tact DB
  • create COT from restart
  • restart and use COT
  • Running migrations from run_command (see script below):

@arthanson arthanson marked this pull request as ready for review December 17, 2025 21:33
@arthanson arthanson requested a review from bctiemann December 17, 2025 21:33
@bctiemann bctiemann merged commit 392e830 into main Dec 18, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

remove global exception handling on _all_migrations_applied

3 participants