Closed evaporei closed 5 years ago
There were the following issues with your Pull Request
Check out our Git Style Guide here: https://github.com/pagarme/git-style-guide
This message was auto-generated by https://gitcop.com
@jeanaugustoos , achei que tinha tirado, por algum motivo devo ter perdido a mudança. Adicionei agora :slightly_smiling_face:
@0liveira @jeanaugustoos , eu adicionei o fix para produção tbm
Description
This Pull Request aims at fixing two problems:
umzug
and don't work properly;The tests were failing and the
make migrate
wasn't working properly. So I decided to unify the way the project usesmigrations
. Since inproduction
we already usesequelize-cli
, why should the tests useumzug
? So this Pull Request removesumzug
, usessequelize-cli
on test/development migrations.Also there was a problem with our config system, even though it worked on code, the
sequelize-cli
couldn't import thegetConfig
in the--config
path because the function was curried, if you didn't pass theenv
it would return a function instead of the configuration.The production migrations didn't work because the path to them was wrong and the
getConfig
function returned a function instead of a object.Another problem with our
production
migrations is that thedotenv
, which would load database config, was not called. So I fixed this by adding this onsrc/config/index.js
, now every configuration file would have the correct configuration.Changes:
umzug
;getConfig
to not be curried;setup
npm script;script/setup
file which did the migrations usingumzug
;sequelize-cli
on test/development migrations;docker-compose.yml
so that services are up at correct time;src
to production's path on migrations;dotenv
initialization toinstrumentation
module;dotenv
initialization onsrc/config/index.js
so that every file which asks for configuration, will get correct information. Example:src/config/database.js
is called bysequelize-cli
and now will have the correct data to connect with the database;Obs: maybe my Pull Request has wierd text or wierd code, forgive me, I did it on Black Friday dawn.
Your checklist for this pull request
:rotating_light: Please review this items for a good pull request. :four_leaf_clover:
In a good pull request, everything above is true :relaxed: