{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/4314","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/4314/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/4314/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/4314/events","html_url":"https://github.com/sequelize/sequelize/issues/4314","id":100736668,"number":4314,"title":"Datatypes validations are too strict!","user":{"login":"janmeier","id":1210224,"avatar_url":"https://avatars.githubusercontent.com/u/1210224?v=3","gravatar_id":"","url":"https://api.github.com/users/janmeier","html_url":"https://github.com/janmeier","followers_url":"https://api.github.com/users/janmeier/followers","following_url":"https://api.github.com/users/janmeier/following{/other_user}","gists_url":"https://api.github.com/users/janmeier/gists{/gist_id}","starred_url":"https://api.github.com/users/janmeier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janmeier/subscriptions","organizations_url":"https://api.github.com/users/janmeier/orgs","repos_url":"https://api.github.com/users/janmeier/repos","events_url":"https://api.github.com/users/janmeier/events{/privacy}","received_events_url":"https://api.github.com/users/janmeier/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sequelize/sequelize/labels/bug","name":"bug","color":"d7e102"},{"url":"https://api.github.com/repos/sequelize/sequelize/labels/regression","name":"regression","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":18,"created_at":"2015-08-13T10:45:27Z","updated_at":"2015-09-14T15:39:16Z","closed_at":null,"body":"Yes, we know - yes we are going to fix it soon :). However, your contributions are also very welcomed\r\n\r\n* Number should allow number strings (i.e. `'1'` is a valid integer)\r\n* Similarly, numbers are valid strings https://github.com/sequelize/sequelize/issues/4255\r\n* Booleans should allow 1/0 (possibilty also as strings?\r\n* The datatype should only be validate on insert / update, at least for some types: Examples\r\n  * Like doesn't work on uuids (`'%foo%`) is not a valid uuid https://github.com/sequelize/sequelize/issues/4198\r\n  * Like any doesn't work on postgres (attempts to validate an array as strings) https://github.com/sequelize/sequelize/issues/4313\r\n* (Maybe) A flag that disables the validations completely\r\n\r\nI've closed the issues linked here, since they all relate to the same basic problem.\r\n\r\n_Important:_ I don't think we should roll back the validation function - it still has its merits. For affected users, either roll back to 3.4.1, or remove the validte function `DataTypes.INTEGER.validate = function () { return true };`\r\n\r\nAs mentioned, at least some validators should only be run on update / insert. My suggestion would be to add a `context` parameter to the `validate` function, so for example uuids are only validated when inserted / updated. We might also add a context like `nested`, to show the the value comes from a `$like { $any` or similar, and might be an array, object etc. "},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/140118652","html_url":"https://github.com/sequelize/sequelize/issues/4314#issuecomment-140118652","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/4314","id":140118652,"user":{"login":"Julusian","id":1327476,"avatar_url":"https://avatars.githubusercontent.com/u/1327476?v=3","gravatar_id":"","url":"https://api.github.com/users/Julusian","html_url":"https://github.com/Julusian","followers_url":"https://api.github.com/users/Julusian/followers","following_url":"https://api.github.com/users/Julusian/following{/other_user}","gists_url":"https://api.github.com/users/Julusian/gists{/gist_id}","starred_url":"https://api.github.com/users/Julusian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Julusian/subscriptions","organizations_url":"https://api.github.com/users/Julusian/orgs","repos_url":"https://api.github.com/users/Julusian/repos","events_url":"https://api.github.com/users/Julusian/events{/privacy}","received_events_url":"https://api.github.com/users/Julusian/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T15:39:16Z","updated_at":"2015-09-14T15:39:16Z","body":"I agree, something needs to be done. An option to disable all validation would be ideal.\r\nI really don't like that I've had to limit all my projects to 3.4 in package.json"}}