Prisma schema: Remove empty dbgenerated()
attribute
#19313
Labels
domain/schema
Issue in the "Schema" domain: Prisma Schema, Introspection, Migrations etc.
kind/tech
A technical change.
tech/engines
Issue for tech Engines.
topic: breaking change
topic: dbgenerated
topic: default
Example
In the times of old, an empty
dbgenerated()
in a@default
field attribute was used by the introspection in fields, where we could not parse the default value correctly. Later on in the migration engine, we started to use it to pass custom SQL, and an empty value is in general just skipped.In the real world, an empty
dbgenerated()
can cause drift and weird panics. We allow it in the PSL for backwards-compatibility. We should make it a validation error. The user can justdb pull
the database and get a non-empty value to the field’s default attribute.Bytes
defaults properly instead of usingdbgenerated
(anddbgenerated()
for empty defaults) #20074dbgenerated()
still breaking forUnsupported()
types #15654The text was updated successfully, but these errors were encountered: