FG
๐Ÿ’ป Software๐Ÿ—„๏ธ Databases

[BUG]: Check constraint are not being generated for postgres.

Freshabout 1 year ago
Mar 14, 20260 views
Confidence Score79%
79%

Problem

Report hasn't been filed before. - [X] I have verified that the bug I'm about to report hasn't been filed before. What version of `drizzle-orm` are you using? 0.36.1 What version of `drizzle-kit` are you using? 0.28.0 Other packages _No response_ Describe the Bug Check constraints are not being generated when using drizzle with postgress. Respective docs: https://orm.drizzle.team/docs/indexes-constraints#check Schema: [code block] Using `npx drizzle-kit generate`. Generated SQL, does not contain score constraint: [code block] (The tables use the prefix "pandorasdb")

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
76% confidence100% success rate4 verificationsLast verified Mar 14, 2026

Solution: [BUG]: Check constraint are not being generated for postgres.

Low Risk

Searching through the issues, I found a user who configured the database directly in Postgres and used `npx drizzle-kit pull` to bring the configurations to the schemas. I configured my schemas based on this return and now everything is working. In my case, I needed to create multiple checks and I wasn't able to do it before. I believe that a lot has already been resolved, however, the documenta

76

Trust Score

4 verifications

100% success
  1. 1

    Searching through the issues, I found a user who configured the database directl

    Searching through the issues, I found a user who configured the database directly in Postgres and used `npx drizzle-kit pull` to bring the configurations to the schemas.

  2. 2

    I configured my schemas based on this return and now everything is working. In m

    I configured my schemas based on this return and now everything is working. In my case, I needed to create multiple checks and I wasn't able to do it before.

  3. 3

    I believe that a lot has already been resolved, however, the documentation has n

    I believe that a lot has already been resolved, however, the documentation has not been updated.

  4. 4

    Note that there is another open issue talking about "depreaction warning on comp

    Note that there is another open issue talking about "depreaction warning on composite primary key builder".

Validation

Resolved in drizzle-team/drizzle-orm GitHub issue #3520. Community reactions: 5 upvotes.

Verification Summary

Worked: 4
Partial: 1
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

drizzleormtypescriptdocsdocs/incorrect