pagarme / superbowleto

:football: A microservice to issue, register and manage boletos
MIT License
5 stars 0 forks source link

Fix migrations #297

Closed evaporei closed 5 years ago

evaporei commented 5 years ago

Description

This Pull Request aims at fixing two problems:

The tests were failing and the make migrate wasn't working properly. So I decided to unify the way the project uses migrations. Since in production we already use sequelize-cli, why should the tests use umzug? So this Pull Request removes umzug, uses sequelize-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 the getConfig in the --config path because the function was curried, if you didn't pass the env 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 the dotenv, which would load database config, was not called. So I fixed this by adding this on src/config/index.js, now every configuration file would have the correct configuration.

Changes:

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:

  1. I've read the project's Contributing Guidelines
  2. My commits are well written and follow pagarme/git-style-guide
  3. My changes are well covered by tests and logs
  4. I've updated the project docs (if needed)
  5. I fell safe about this implementation
  6. I feel comfortable with the code I wrote, and I'm not ashamed to show it to my friends

In a good pull request, everything above is true :relaxed:

GitCop commented 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

evaporei commented 5 years ago

@jeanaugustoos , achei que tinha tirado, por algum motivo devo ter perdido a mudança. Adicionei agora :slightly_smiling_face:

evaporei commented 5 years ago

@0liveira @jeanaugustoos , eu adicionei o fix para produção tbm