Error in migration engine: We should only be setting a changed default if there was one on the previous schema and in the next with the same enum. #15927
Labels
kind/bug
A reported bug.
team/schema
Issue for team Schema.
tech/engines/datamodel
Issue about parsing/validation/rendering of the Prisma schema
topic: error reporting
Issues created via Prisma's CLI Crash Reporting
topic: postgresql
Command:
prisma migrate dev
Version:
4.5.0
Binary Version:
0362da9eebca54d94c8ef5edd3b2e90af99ba452
Report: https://prisma-errors.netlify.app/report/14387
OS:
arm64 darwin 21.6.0
Rust Stacktrace:
Context
This error is happening because we're attempting to unwrap a
None
value intodefault_str
via anexpect()
call:https://github.com/prisma/prisma-engines/blob/1efe6d372597cdb48067c5dd1f441702a1b0861e/migration-engine/connectors/sql-migration-connector/src/sql_renderer/postgres_renderer.rs#L1006-L1020
Potential Solution
I think we should conditionally apply the
SET DEFAULT
expression in the pushed statement only whendefault_str
is aSome(_)
. I could easily do that as a side task.The text was updated successfully, but these errors were encountered: