Related issue
prisma/prisma#29220
Problem
Since partial index support was added (PR #5749), the SQL schema describer always returns index predicates from the database regardless of whether the partialIndexes preview feature is enabled. When the feature is off:
- Database schema (from
describe_schema): index has predicate = Some("...")
- Target schema (from PSL): index has
predicate = None
The differ calls predicates_match(Some("..."), None) → returns false → the index is treated as changed → generates a needless DROP INDEX + CREATE INDEX on every schema_push / migrate dev, even when no schema changes were made.
This affects users who manually added partial indexes via custom SQL in migration files (the recommended workflow before partialIndexes existed) or directly in the database. Previously these indexes were invisible to the differ; now they cause drift on every invocation.
Expected behavior
When partialIndexes is not enabled, the schema engine should ignore index predicates entirely — both in the database schema and the target schema. Manually created partial indexes should be left untouched.
Related issue
prisma/prisma#29220
Problem
Since partial index support was added (PR #5749), the SQL schema describer always returns index predicates from the database regardless of whether the
partialIndexespreview feature is enabled. When the feature is off:describe_schema): index haspredicate = Some("...")predicate = NoneThe differ calls
predicates_match(Some("..."), None)→ returnsfalse→ the index is treated as changed → generates a needlessDROP INDEX+CREATE INDEXon everyschema_push/migrate dev, even when no schema changes were made.This affects users who manually added partial indexes via custom SQL in migration files (the recommended workflow before
partialIndexesexisted) or directly in the database. Previously these indexes were invisible to the differ; now they cause drift on every invocation.Expected behavior
When
partialIndexesis not enabled, the schema engine should ignore index predicates entirely — both in the database schema and the target schema. Manually created partial indexes should be left untouched.