Hi, I'm trying to declare a `CHECK CONSTRAINT` in ...
# orm-help
y
Hi, I'm trying to declare a
CHECK CONSTRAINT
in my
schema.prisma
file, since SQL Server doesn't support
ENUM
. Does anyone know how this can be accomplished? Is there a way to include raw SQL as part of the schema?
r
@Yaakov 👋 Check constraints can only be defined in the Migration
.sql
files as of now. To add a check constraint: 1. Create a migration using
prisma migrate dev --create-only
2. Edit the
.sql
file and add the check constraint 3. Apply the migration with
prisma migrate dev
.
y
@Ryan Thanks! I'd love to see Prisma allow Enums for SQL Server and under-the-hood perform a check constraint.
r
@Yaakov We do have a feature request here so it would be great if you could add a 👍 to this 🙂
y
Just did. Thanks!
🙌 1