-
-
Notifications
You must be signed in to change notification settings - Fork 527
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
db:migrate returns status code 0 when migration fails #110
Comments
It would be nice if you could create a test as a pull request that shows the failing behavior. Otherwise I'll try to take a look at it at some point. |
var sh = require('execSync');
var result = sh.exec('node_modules/.bin/sequelize db:migrate');
if(result.code === 0 && result.stdout.indexOf('SequelizeDatabaseError') > -1) {
console.error('result has SequelizeDatabaseError but return code is 0');
throw new Error(result.stdout);
} else {
console.info(result.stdout);
} you can run this with a migration that will fail (duplicate table, duplicate type...). |
+1. We need to fail deployments that didn't migrate correctly, and without an exit code our deployment scripts can't tell that they failed. |
+1 |
1 similar comment
+1 |
fixed in 1.7.4 |
codetriage-readme-bot
pushed a commit
to codetriage-readme-bot/cli
that referenced
this issue
Jun 5, 2019
Update development instrucitons in Readme
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Migration failures on db level are not handled properly and the command returns success code 0 and prints
Using environment 'development'.
== 20150318142814-init: migrating =======
Possibly unhandled SequelizeDatabaseError: type "enum_Group_status" already exists
The text was updated successfully, but these errors were encountered: