Do migrations work in Electron? #1891
Replies: 2 comments 1 reply
-
@VitorAndrey you have to find a way to run the migrations script in electron before the build process runs. i was having similar issues with docker container on production build but i fixed them. you can take a look at it here -> https://github.com/deadcoder0904/easypanel-nextjs-sqlite make sure to look at previous commits if you are not interested in how i'm doing things with docker (which is complicated if you don't know docker) but the previous commits include just |
Beta Was this translation helpful? Give feedback.
-
This can be solved by attaching a migrations directory to your electron files during the build process. Then you can point to the extras/resources directory after the app unpacks it. This directory is accessible by user so if you have some sensitive data in your migrations it will not be a good solution. |
Beta Was this translation helpful? Give feedback.
-
Hi everyone, thanks for your time and support in advance.
I've come across some topics about migrations with Electron, but I'm still not sure how to proceed. I'm sorry if this is a trivial question, but how can I make it work? I'm using Electron-vite for scaffolding the project, and in development, it works.
But then it throws an error after the build:
Error: Can't find meta/_journal.json file at readMigrationFiles
drizzle.config.ts:
src/database/index.ts:
Beta Was this translation helpful? Give feedback.
All reactions