Non negative integer column type #1830
laurent512
started this conversation in
General
Replies: 1 comment 1 reply
-
In Drizzle, the easiest way to enforce a column to accept only 0 and strictly positive integer values is by using int type with a CHECK constraint. If you're using PostgreSQL, you can define it like this: `import { integer, pgTable } from "drizzle-orm/pg-core"; export const myTable = pgTable("my_table", { |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
What is the easiest approach to have a columns with type integer for only 0 & strictly positive values ?
Thank you in advance :)
Beta Was this translation helpful? Give feedback.
All reactions