-
Notifications
You must be signed in to change notification settings - Fork 33
[$30] Use existent env variable during DB migration #634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@yoution feel free to pick up if you like. |
@maxceem please assign to me |
Challenge https://www.topcoder.com/challenges/00fdb431-2c2c-47ac-ac30-f42d8b5b7e79 has been created for this ticket. |
Challenge https://www.topcoder.com/challenges/00fdb431-2c2c-47ac-ac30-f42d8b5b7e79 has been assigned to yoution. |
Payment task has been updated: https://www.topcoder.com/challenges/00fdb431-2c2c-47ac-ac30-f42d8b5b7e79 |
We have a migration command which migrate DB:
npm run migrate
. Underneath it calls built-in sequelize command https://sequelize.org/master/manual/migrations.html.At the moment when we run this script on DEV or PROD we have to pass several environment variables
DB_USERNAME
,DB_PASSWORD
,DB_NAME
andDB_HOST
. Though we already have env variable which defines DB connection settings using env variableDATABASE_URL
with the value which looks likepostgres://postgres:postgres@localhost:5432/postgres
.We don't want to provide separate values
DB_USERNAME
,DB_PASSWORD
,DB_NAME
andDB_HOST
instead, we would like to update this config so it:don't use
DB_USERNAME
,DB_PASSWORD
,DB_NAME
andDB_HOST
anymoreparses the value inside
DATABASE_URL
and split it into value required by thesequelize
:It should be done for all envs:
development
,test
,production
development
andtest
environments, but not forproduction
make sure that migration script works only by setting
DATABASE_URL
The text was updated successfully, but these errors were encountered: