This spec acts as the central place for all discussions around data model syntax. It contains new syntax for existing features as well as missing features.
timeline: Currently we do not have a timeline yet for those features. First we want to settle on a spec together with the community. Then we will start to plan the actual implementation of those features.
handling of breaking changes: The spec contains some breaking changes. We are aware that this would be a huge burden for existing projects. Therefore we plan to offer an easy way to migrate existing projects to the new syntax, e.g. by rewriting the data model on version upgrade.
The goals for this spec are:
migrations setting in the server config). This means that Prisma will provide defaults for many things but is still configurable through the use of directives. This will enable seamless switching between the active and passive modes.For better readability the spec has been split into multiple parts:
@db@linkTable@embedded@indexes@discriminator@id@createdAt@updatedAt@default@db@scalarList@sequence@relation@unique@inheritanceWill datamodel v1.1 allow for us to add custom scalars to Prisma datamodel? Like,
scalar IP
type MyType {
ip: IP!
}
The datamodel v1.1 is ready to be tested ๐ You can find all instructions how to get started in this GitHub repo.
@nikolasburk I have installed the latest beta 1.31.0-beta.1 just to test introspect
I followed your instructions in this
After running this
prisma introspect --prototype -e .env
prisma deploy -e .env
I got the following errors
AmAdmin
โ The value 0 is not a valid default for fields of type Boolean.
AmAgreement
โ The value 0 is not a valid default for fields of type Boolean.
AmBillingPlan
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
AmButton
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
AmCouponBatch
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
AmEmailTemplate
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 1 is not a valid default for fields of type Boolean.
AmInvoice
โ The value 0 is not a valid default for fields of type Boolean.
AmInvoiceItem
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
AmInvoiceLog
โ The value 0 is not a valid default for fields of type Boolean.
AmProduct
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
AmProductOption
โ The value 0 is not a valid default for fields of type Boolean.
AmProductUpgrade
โ The value 0 is not a valid default for fields of type Boolean.
AmResourceAccess
โ The value 0 is not a valid default for fields of type Boolean.
AmUser
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 1 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
โ The value 0 is not a valid default for fields of type Boolean.
AmUserStatus
โ The value 0 is not a valid default for fields of type Boolean.
AmAccessCachefnEnum
โ The enum type AmAccessCachefnEnum contains invalid enum values. The first character of each value must be an uppercase letter.
AmAccessCachestatusEnum
โ The enum type AmAccessCachestatusEnum contains invalid enum values. The first character of each value must be an uppercase letter.
AmCountrystatusEnum
โ The enum type AmCountrystatusEnum contains invalid enum values. The first character of each value must be an uppercase letter.
AmCouponBatchdiscountTypeEnum
โ The enum type AmCouponBatchdiscountTypeEnum contains invalid enum values. The first character of each value must be an uppercase letter.
AmEmailTemplateformatEnum
โ The enum type AmEmailTemplateformatEnum contains invalid enum values. The first character of each value must be an uppercase letter.
AmResourceAccessfnEnum
โ The enum type AmResourceAccessfnEnum contains invalid enum values. The first character of each value must be an uppercase letter.
AmStatestatusEnum
โ The enum type AmStatestatusEnum contains invalid enum values. The first character of each value must be an uppercase letter.
BTW : I'm using mysql
UPDATE :
after fixing the errors above manually and ran prisma deploy
I got this error
"message":"Bad(InvalidValueForScalarType("CURRENT_TIMESTAMP",DateTime)).get"
Most helpful comment
Will datamodel v1.1 allow for us to add custom scalars to Prisma datamodel? Like,