DT
Drizzle Team•11mo ago
ethan

unable to use migrations

hey, im trying to run a migration and i keep getting this error. generating the json file worked just fine. i pasted the code and error below. any help would be appreciated, ty!
No description
No description
20 Replies
ethan
ethanOP•11mo ago
fixed that error but now im getting this
No description
Naeemgg
Naeemgg•11mo ago
can you show db and client file maybe something is off there
Mykhailo
Mykhailo•11mo ago
@ethan do you get this error when you run migrations? Could you please provide migration code?
ethan
ethanOP•11mo ago
No description
ethan
ethanOP•11mo ago
yep only when i run migrations. generating works fine though. what do you mean by the migration code? this is the js im using for that but if you mean the sql file thats generated lmk
No description
Naeemgg
Naeemgg•11mo ago
You can use try catch within migrateDB and just call it after Can you successfully run drizzle-kit generate:pg
ethan
ethanOP•11mo ago
yes it works for me
No description
Naeemgg
Naeemgg•11mo ago
drizzle-kit introspect:pg ?
ethan
ethanOP•11mo ago
also works
No description
Naeemgg
Naeemgg•11mo ago
🤔 You got connection string right Then what could possibly the cause Have you tried to delete and reinstall node modules?? Sometimes it does the job
ethan
ethanOP•11mo ago
yep ive tried deleting the whole project and recloning and my friend is also getting the error on his end connection string should be right drizzle is working fine for CRUD
Naeemgg
Naeemgg•11mo ago
Just to be clear, you're using postgres on localhost right?
ethan
ethanOP•11mo ago
yeah but im not hosting the db locally im using supabase
Naeemgg
Naeemgg•11mo ago
Let me try it with supabase I've tried with every driver except supabase and node
ethan
ethanOP•11mo ago
gotcha im honestly just following this tutorial 1s
ethan
ethanOP•11mo ago
Drizzle ORM - Migrate from Prisma to Drizzle
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
ethan
ethanOP•11mo ago
step 4 is where im stuck at
variable_name
variable_name•10mo ago
Hey, how did you solve this problem? I'm running into same issue.
Naeemgg
Naeemgg•10mo ago
supabase?
variable_name
variable_name•10mo ago
It's fixed. There were some issues with environment variables in turbo repo.

Did you find this page helpful?