Guide on how to apply migrations (Nextjs/ @neondatabase/serverless)
Recently decided to try Neon for my portfolio V2 api. I'm working with Nextjs 14, drizzle and Neon. I'm having difficulties applyinig migrations to Neon locally.
Here is my
migrate file
In my package.json i have this script to execute the migrate file in my src dir
I'm not sure what the issue is but whenever i run this command, It throws error
I'm new to neon and don't know what i'm missing. Woulkd appreciate any resource/guide to achieving this
Thanks2 Replies
frail-apricot•2y ago
@Ogbonna is
/src/migrations being interpreted as an absolute path? Drop the leading slash, so it looks like src/migrations and try again. Also, is there a reason you call it twice?
Generally when dealing with paths, it's good to resolve them. Maybe something like this could help you?
national-gold•2y ago
If you have a defineConfig defined, make sure you're actually defining the target directory there.
Example