Join Slack
Powered by
Hey guys, does prisma support CHECK constraint out...
# orm-help
b
Brook MG
06/16/2022, 5:56 AM
Hey guys, does prisma support CHECK constraint out of the box? Like defining it in the schema.
✅ 1
n
Nurul
06/16/2022, 6:30 AM
Hey Brook 👋 Not possible in the schema directly, but you can use Migrate to achieve this: 1. Create the migration using
prisma migrate dev --create-only
2. Edit the generated
.sql
file and add the check constraint 3. Run
prisma migrate dev
to apply the migration.
🙌 1
2
Views
Open in Slack
Previous
Next