Preserve partial index predicates in migrations#31
Merged
mr-fatalyst merged 1 commit intoMay 8, 2026
Conversation
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.
Summary
Index(where=...)predicates in migration schema snapshots.Tests Added
Added a focused schema extraction regression test; verifies
Index(where=...)survivesextract_current_schema()test_extract_partial_index_where_in_snapshotAdded Python migration SQL coverage; verifies PostgreSQL/SQLite render
WHERE ...and MySQL raises a clear unsupported-dialect error.test_create_partial_indextest_create_partial_index_mysql_rejectedAdded full Python migration pipeline coverage; verifies model -> snapshot -> diff -> generated migration -> SQL keeps the partial-index predicate.
test_create_partial_index_preserves_whereAdded Rust migration diff and SQL coverage; verifies predicate changes rebuild indexes, whitespace-only differences are ignored, partial-index SQL is emitted for supported dialects, and JSON round-tripping preserves normalized predicates.
test_compute_diff_detects_partial_index_predicate_changetest_compute_diff_ignores_partial_index_predicate_whitespacetest_partial_index_sqltest_partial_index_json_roundtrip_trims_predicateFixes #30