Skip to content

refactor: migrate ENABLE_CSMH_EXTENDED off FEATURES-as-dict in the CSM bigint migration - #39006

Merged
feanil merged 1 commit into
masterfrom
feanil/features-dict-csmh-extended-migration
Aug 20, 2026
Merged

refactor: migrate ENABLE_CSMH_EXTENDED off FEATURES-as-dict in the CSM bigint migration#39006
feanil merged 1 commit into
masterfrom
feanil/features-dict-csmh-extended-migration

Conversation

@feanil

@feanil feanil commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

ENABLE_CSMH_EXTENDED is a flat setting (openedx/envs/common.py, default True); its app readers (courseware/models.py) and tests already use settings.ENABLE_CSMH_EXTENDED. The 2019 0011_csm_id_bigint data migration still read settings.FEATURES["ENABLE_CSMH_EXTENDED"] in two places:

  • the Migration class body, evaluated at import time (on every migrate / makemigrations / test-DB build), gating an extra dependency; and
  • database_forwards(), gating the studentmodulehistoryextended ALTER TABLE.

Switch both to bare settings.ENABLE_CSMH_EXTENDED, matching models.py. Behavior is identical, and reading the flat setting keeps the migration working for the deployments that still apply it.

Verified the migration module imports cleanly under LMS settings (the import-time dependency list resolves correctly) and the coursewarehistoryextended tests pass. (The pre-existing unused models import is left as-is; migrations are excluded from ruff.)

@feanil
feanil force-pushed the feanil/features-dict-csmh-extended-migration branch 2 times, most recently from 9503f3d to d3c6d0c Compare August 19, 2026 15:50
…M bigint migration

ENABLE_CSMH_EXTENDED is a flat setting (openedx/envs/common.py, default True); its app
readers (courseware/models.py) and tests already use settings.ENABLE_CSMH_EXTENDED. The
2019 0011_csm_id_bigint data migration still read settings.FEATURES["ENABLE_CSMH_EXTENDED"]
in two places:
- the Migration class body, evaluated at import time (on every migrate / makemigrations /
  test-DB build), gating an extra dependency; and
- database_forwards(), gating the studentmodulehistoryextended ALTER TABLE.

Switch both to bare settings.ENABLE_CSMH_EXTENDED, matching models.py. Behavior is
identical, and reading the flat setting keeps the migration working for the deployments
that still apply it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@feanil
feanil force-pushed the feanil/features-dict-csmh-extended-migration branch from d3c6d0c to 8d76a1c Compare August 19, 2026 15:52
@feanil
feanil marked this pull request as ready for review August 19, 2026 15:54
@feanil
feanil enabled auto-merge (rebase) August 19, 2026 15:55
@feanil
feanil requested a review from kdmccormick August 19, 2026 15:55
@feanil
feanil merged commit 163f28d into master Aug 20, 2026
48 of 60 checks passed
@feanil
feanil deleted the feanil/features-dict-csmh-extended-migration branch August 20, 2026 13:47
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.

2 participants