Mykhailo
Mykhailo
DTDrizzle Team
Created by Acro on 3/21/2024 in #help
When to use what? drizzle-kit push:* Vs. having a file with drizzle migrate client?
drizzle-kit migrate use migrate function under the hood
6 replies
DTDrizzle Team
Created by Acro on 3/21/2024 in #help
When to use what? drizzle-kit push:* Vs. having a file with drizzle migrate client?
hey @adrtivv! no, there is no difference between them
6 replies
DTDrizzle Team
Created by Angel on 6/5/2024 in #help
UUID Cast error with pg and aws-data-api in kit studio
Hey @g63sol. I will ask developer who worked on this and I will come back with the answer
9 replies
DTDrizzle Team
Created by Dari on 7/3/2024 in #help
Drizzle Push to Turso fails on third attempt
Hey @Dari. The problem lies with your schema. You should change current_timestamp to (current_timestamp) and reset your database
3 replies
DTDrizzle Team
Created by Angel on 6/5/2024 in #help
UUID Cast error with pg and aws-data-api in kit studio
This is bug and will be fixed
9 replies
DTDrizzle Team
Created by wylex on 6/14/2024 in #help
__old_push table
Got it, could you show municipio table please?
4 replies
DTDrizzle Team
Created by wylex on 6/14/2024 in #help
__old_push table
Hey @wylex Could you show your schema please?
4 replies
DTDrizzle Team
Created by mutex on 6/9/2024 in #help
Use COALESCE in index
got it, I will reproduce and make issue for this case. thank you!
4 replies
DTDrizzle Team
Created by mutex on 6/9/2024 in #help
Use COALESCE in index
Hey @mutex! Try to wrap into parentheses:
uniqueIndex("IndexName").on(table.foo, sql`(COALESCE(${table.bar}, ''))`)
uniqueIndex("IndexName").on(table.foo, sql`(COALESCE(${table.bar}, ''))`)
4 replies
DTDrizzle Team
Created by Jeremy on 5/4/2024 in #help
Is there a way to have Prototype / Push run without confirmation?
Hey @BumontheRun @Jeremy. Make sure to off strict parameter in your drizzle.config.ts file. https://orm.drizzle.team/kit-docs/config-reference#strict If we speak about data loss confirmation then it is not possible to skip now
4 replies
DTDrizzle Team
Created by Cambaru on 6/9/2024 in #help
Creating DB with schema
Hey @Cambaru! You should specify mode for your schema in drizzle parameters like here: https://orm.drizzle.team/docs/rqb#modes
2 replies
DTDrizzle Team
Created by Carlos Ziegler on 6/6/2024 in #help
Next Js middleware error " ⨯ cloudflare:socketsModule build failed: UnhandledSchemeError: Readin":
Hey @Carlos Ziegler! What db client are you using?
2 replies
DTDrizzle Team
Created by Fair Enough on 6/7/2024 in #help
Weird unique constraint
Hey @MyMainWasBanned. You can create unique index with lower expression You can check this guide to learn how to do unique case insensitive column based on email https://orm.drizzle.team/learn/guides/unique-case-insensitive-email
2 replies
DTDrizzle Team
Created by louis on 6/7/2024 in #help
Reference the same table
Hey @Louis. You should add type AnyPgColumn
import { AnyPgColumn } from 'drizzle-orm/pg-core';

manager: text("user_id").references((): AnyPgColumn => authUser.id),
import { AnyPgColumn } from 'drizzle-orm/pg-core';

manager: text("user_id").references((): AnyPgColumn => authUser.id),
4 replies
DTDrizzle Team
Created by diurivj on 5/25/2024 in #help
Drizzle studio doesn't handle timestamps properly
Hey @DiamondDragon. I will reproduce this issue and will reply later
4 replies
DTDrizzle Team
Created by Paul on 6/3/2024 in #help
How to set a GIN index on the JSONB column?
Hey @Paul! You can use new index API for orm version 0.31 or higher & drizzle-kit version 0.22.0 or higher.
ginIndex1: index('gin_idx')
.using('gin', t.metadata),
ginIndex2: index('gin_idx_2')
.using('gin', sql`(metadata->'name')`),
ginIndex1: index('gin_idx')
.using('gin', t.metadata),
ginIndex2: index('gin_idx_2')
.using('gin', sql`(metadata->'name')`),
https://github.com/drizzle-team/drizzle-orm/releases/tag/0.31.0 But I am not sure about the second one
3 replies
DTDrizzle Team
Created by Paul on 6/3/2024 in #help
When using a foreignKey({}), is there a way to specify onDelete: "cascade'?
Yep, we will add it to the docs, thanks!
4 replies
DTDrizzle Team
Created by Paul on 6/3/2024 in #help
When using a foreignKey({}), is there a way to specify onDelete: "cascade'?
Hey @Paul. Try this
userIdReference: foreignKey({
columns: [table.userId],
foreignColumns: [users.userId],
name: "accounts_user_id_fk",
})
.onDelete("cascade")
// .onUpdate("cascade"),
userIdReference: foreignKey({
columns: [table.userId],
foreignColumns: [users.userId],
name: "accounts_user_id_fk",
})
.onDelete("cascade")
// .onUpdate("cascade"),
4 replies
DTDrizzle Team
Created by ar7casper on 5/29/2024 in #help
Migration and existing policy issues
Hey @Qing @ quotion.co, as of now, Drizzle does not generate the 'IF NOT EXISTS' statement in migration SQL directly. However, in the future, there will be an option to generate SQL with or without the 'IF NOT EXISTS' statement.
6 replies
DTDrizzle Team
Created by andystevenson on 5/29/2024 in #help
weirdness with sql`CURRENT
It won't fix your issue because there is a problem in drizzle studio. But team knows this bug, so it will be fixed:) (CURRENT_TIMESTAMP) instead of CURRENT_TIMESTAMP just prevents issues that could be raised by push command because Drizzle Kit can misidentify if it is a string or constraint, so parentheses are important
5 replies