You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
db update asks for confirmation when a Mongo field's validator only widens to any value #30469
What a user sees. Changing a Mongo field from Json to Bson changes its validator from the list of JSON types to {}, which admits every value that was admitted before. prisma db update still reports the change as destructive and asks the user to confirm by typing the database name (or pass --confirm <database>). The same happens for any property schema that widens to {}.
Where.isWideningSchemaChange in packages/3-mongo-target/1-mongo-target/src/core/migrations/mongo-planner.ts, which classifies any change to an existing property schema it does not recognise as destructive.
Likely fix. Teach isWideningSchemaChange that a destination schema of {} (or { bsonType: 'array', items: {} } over any array schema) admits everything the origin admitted, so the change is widening. Add planner tests for Json to Bson on a single field and a list field.
Where it came from.#30439, which introduced Bson and the typed Json validator.
Activity
fix(mongo): every value the ORM writes, reads or filters on goes thro…