manelferreira / serverless-sequelize-migrations

A Serverless plugin to manage sequelize migrations
MIT License
21 stars 17 forks source link

Fix password env variable to prevent falsey values breaking migrations #13

Closed leofontes closed 4 years ago

leofontes commented 4 years ago

Hey everyone,

Decided to make a PR to fix this given that it gave me a lot of trouble yesterday, the way it is current set up, a falsey value (ie false, 0, null, undefined) leads the plugin to believe the user didn't set up the DB_PASSWORD field.

Changed this just for the DB_PASSWORD field because I don't think it's reasonable to have those values anywhere else, but we could apply that logic to all the fields to be consistent, up to you @manelferreira.

Thank you :)

manelferreira commented 4 years ago

Hi Leo, how are you?

Thank you very much for creating this PR! I wrote some test cases for this scenario and merged everything on master.

I'll create an updated version of the plugin on npm.