Hey guys, I have a question:
For Security reasons, I have one database user that can do DDL commands called 'migrations' and other that can do DQL and DML called 'application'
Let's think that I a have a production code with prisma and I have a pipeline to publish my api, the first step of my pipeline is to run the migrations step...
My question is, how do you guys do with multiple database users? I'm thinking in have one .env.migration file with 'migration' database user and other .env file to run the app in production
Is this a good way to handle this situation or is there another better way?
✅ 1
n
Nurul
05/02/2022, 9:45 AM
Hey Paul 👋
Yes, you could have multiple env files, one for each environment which would have database user details.
You might want to use dotenv to manage multiple env files, Here’s our reference on how you could manage multiple env files.