Refactor removal of deprecated features while preserving database state#15009
Merged
Conversation
…Manager features to preserve database state
…e-only removal The state-only removal in 0266 left dojo_system_settings.enable_credentials in place (NOT NULL, no DB default) for downgrade safety, but the model no longer supplies a value on INSERT. New System_Settings rows then failed with a NotNullViolation, surfacing as 28 errors in unittests.test_apply_finding_template. Split the field handling into its own SeparateDatabaseAndState: drop the field from Django state while a database_operations RunSQL sets a server-side default of true (matching the field's original default) on the retained column, so inserts that omit it still satisfy the NOT NULL constraint. Verified locally: the 28 test_apply_finding_template errors reproduce before the change and pass after; makemigrations --check reports no drift; and the cred_*/stub_finding tables, the enable_credentials column, and the cred_user pghistory triggers all remain in the database. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
blakeaowens
approved these changes
Jun 15, 2026
dogboat
approved these changes
Jun 15, 2026
rossops
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Update the migration process to remove the Stub Findings and Credential Manager features from Django's state while retaining their underlying database tables. This approach allows for data preservation during downgrades, ensuring a smoother transition for users.