Hello is it possible in Prisma schema to define (n...
# prisma-client
k
Hello is it possible in Prisma schema to define (numeric)
CHECK
constraints ?
r
@koufatzis 👋 You can do this using Migrate: 1. Create the migration file using
prisma migrate dev --create-only
2. Edit the generated
.sql
file and add the check constraint 3. Apply the migration using
prisma migrate dev
k
Thanks @Ryan. Finally this is what I end up doing. I just wondered if there was a way to define this in prisma schema to not have a discrepancy between migration file and schema
r
Currently not, but there’s a request here that you can add a 👍 to and follow for more updates 🙂
k
Thanks will do that
💯 1