{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/cli/issues/106","repository_url":"https://api.github.com/repos/sequelize/cli","labels_url":"https://api.github.com/repos/sequelize/cli/issues/106/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/cli/issues/106/comments","events_url":"https://api.github.com/repos/sequelize/cli/issues/106/events","html_url":"https://github.com/sequelize/cli/issues/106","id":60277083,"number":106,"title":"CLI Doesn't Halt On Error?","user":{"login":"paulxtiseo","id":2977050,"avatar_url":"https://avatars.githubusercontent.com/u/2977050?v=3","gravatar_id":"","url":"https://api.github.com/users/paulxtiseo","html_url":"https://github.com/paulxtiseo","followers_url":"https://api.github.com/users/paulxtiseo/followers","following_url":"https://api.github.com/users/paulxtiseo/following{/other_user}","gists_url":"https://api.github.com/users/paulxtiseo/gists{/gist_id}","starred_url":"https://api.github.com/users/paulxtiseo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulxtiseo/subscriptions","organizations_url":"https://api.github.com/users/paulxtiseo/orgs","repos_url":"https://api.github.com/users/paulxtiseo/repos","events_url":"https://api.github.com/users/paulxtiseo/events{/privacy}","received_events_url":"https://api.github.com/users/paulxtiseo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2015-03-08T21:25:45Z","updated_at":"2016-11-15T14:11:29Z","closed_at":null,"body":"When I run `sequelize db:migrate` I see the error (and get the root SQL error), but the processing continues onwards to subsequent files instead of halting and allowing the user to fix the error. The first error because I did not know UNSIGNED in a createTable() didn't work against postgresql. The code was just a single createTable() with a done() afterwards. The other was an extra parens in a raw SQL statement that created a function using a `migration.sequelize.query(<string>).nodeify(done)` call.\n\nIn both cases, I did get the proper SequelizeDatabaseError with a message that described the error well, But, it proceeded on with subsequent file... and triggering more errors as dependent objects were not created properly.\n\nUsing Node 0.12.0, CLI 1.3.1 and ORM 2.0.3.\n\nExample error:\n\n```\nPossibly unhandled SequelizeDatabaseError: syntax error at or near \"UNSIGNED\"\n    at module.exports.Query.formatError (/Users/nnnn/Repositories/dddd/server-ah/node_modules/sequelize/lib/dialects/postgres/query.js:361:16)\n    at null.<anonymous> (/Users/nnnn/Repositories/dddd/server-ah/node_modules/sequelize/lib/dialects/postgres/query.js:79:21)\n    at emit (events.js:107:17)\n    at Query.handleError (/Users/nnnn/Repositories/dddd/server-ah/node_modules/pg/lib/query.js:99:8)\n    at null.<anonymous> (/Users/nnnn/Repositories/dddd/server-ah/node_modules/pg/lib/client.js:166:26)\n    at emit (events.js:107:17)\n    at Socket.<anonymous> (/Users/nnnn/Repositories/dddd/server-ah/node_modules/pg/lib/connection.js:109:12)\n    at Socket.emit (events.js:107:17)\n    at readableAddChunk (_stream_readable.js:163:16)\n    at Socket.Readable.push (_stream_readable.js:126:10)\n    at TCP.onread (net.js:529:20)\n```\n"},"comment":{"url":"https://api.github.com/repos/sequelize/cli/issues/comments/260650919","html_url":"https://github.com/sequelize/cli/issues/106#issuecomment-260650919","issue_url":"https://api.github.com/repos/sequelize/cli/issues/106","id":260650919,"user":{"login":"BiletskiyDmitriy","id":12006505,"avatar_url":"https://avatars.githubusercontent.com/u/12006505?v=3","gravatar_id":"","url":"https://api.github.com/users/BiletskiyDmitriy","html_url":"https://github.com/BiletskiyDmitriy","followers_url":"https://api.github.com/users/BiletskiyDmitriy/followers","following_url":"https://api.github.com/users/BiletskiyDmitriy/following{/other_user}","gists_url":"https://api.github.com/users/BiletskiyDmitriy/gists{/gist_id}","starred_url":"https://api.github.com/users/BiletskiyDmitriy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BiletskiyDmitriy/subscriptions","organizations_url":"https://api.github.com/users/BiletskiyDmitriy/orgs","repos_url":"https://api.github.com/users/BiletskiyDmitriy/repos","events_url":"https://api.github.com/users/BiletskiyDmitriy/events{/privacy}","received_events_url":"https://api.github.com/users/BiletskiyDmitriy/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T14:11:29Z","updated_at":"2016-11-15T14:11:29Z","body":"I can reproduce this error.\r\n\r\n`\r\nmodule.exports = {\r\n  up: function(queryInterface, Sequelize) {\r\n    queryInterface.changeColumn('Products', 'max_price', {\r\n      type: Sequelize.INTEGER(11),\r\n      references: {\r\n        model: 'SomeTable',\r\n        key: 'id'\r\n      }\r\n    });\r\n  },\r\n\r\n  down: function(queryInterface) {\r\n    queryInterface.sequelize.query('ALTER TABLE Products DROP FOREIGN KEY Productstest_max_price_foreign_idx;');\r\n    queryInterface.removeIndex('Products', 'Productstest_max_price_foreign_idx');\r\n  }\r\n};\r\n`\r\n\r\nWhen I tried to do sequelize db:migrate:undo, sequelize throws error in the console\r\n`Unhandled rejection SequelizeDatabaseError: Can't DROP 'Productstest_max_price_foreign_idx'; check that column/key exists\r\n`\r\nbut migration was removed anyway\r\n` DELETE FROM `SequelizeMeta` WHERE `name` = '20161115140347-test.js'`\r\n"}}
{"actor":{"display_login":"BiletskiyDmitriy"}}