Best way to seperate environments
Hello,
I use drizzle with cf workers and turso database.
Whats the best way to split my project into a dev and prod database?
So i can develop and change the dev database and push it to the prod database?
Any ideas someone? Thanks yall
3 Replies
@Louis I suggest using env variables with dot-env: https://www.npmjs.com/package/dotenv#-deploying
I also have a script that creates a local proxy to my prod db, then I run my migrations locally against the prod db
npm
dotenv
Loads environment variables from .env file. Latest version: 16.3.1, last published: 6 months ago. Start using dotenv in your project by running
npm i dotenv
. There are 38770 other projects in the npm registry using dotenv.Hi could you explain your dev to prod workflow a little bit more? So you code in your dev change some schemas in your db and then you switch env and run migrate?
Yup
Some people might do it in CI, but I’m okay with my workflow right now