-
-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE]: Add check support in drizzle-kit #880
Comments
+1 to |
+1 to Check support. |
checks would be great, i need it for my code |
+1 to CHECK support |
+1 |
any update for this feature? Check constraint is one of the core feature of any RDBMS. It should be implemented with higher priority. |
Is there a workaround for this with Drizzle's |
Ditto what @efkann said. Is there a workaround with the |
@efkann @arxpoetica I found a workaround when defining a default. It may not work for all use cases but it's working for me. schema: export const exampleTable = schema.table('example_table', {
// ... other columns not included
status: text('status', {
enum: ['pending', 'active', 'suspended', 'archived'],
})
.notNull()
// HACK: Drizzle does not yet support check constraints as of writing this
.default(
sql`'pending' CHECK (status IN ('pending', 'active', 'suspended', 'archived'))`,
),
}); generates: CREATE TABLE IF NOT EXISTS "my_schema"."example_table" (
"status" text DEFAULT 'pending' CHECK (status IN ('pending', 'active', 'suspended', 'archived')) NOT NULL
); |
💎 $20 bounty created by @rvaidun |
/attempt #880 |
@rvaidun, @AndriiSherman before giving my effort to it, can you please let me know if you can assign it to me? |
+1000 for this |
any updates? 👀 |
+1 +1 +1 +1 |
Is there any update on this? |
+2392394 |
+2024 |
+10086 |
+2028812 |
+111 |
+9999999999 |
|
If one more person posts a +1 instead of clicking the 👍 reaction I will cry |
+0.1 |
+1 |
1 similar comment
+1 |
Available in |
Describe what you want
This issue is a part of #229
The text was updated successfully, but these errors were encountered: