Skip to content
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

Add model:generate attribute datatype validation #682

Merged
merged 2 commits into from
Aug 19, 2018

Conversation

Georift
Copy link
Contributor

@Georift Georift commented Aug 14, 2018

I ran into a small problem today when generating some models, it's pretty easy to mistakenly write something like 'someDate:datetime' as an attribute when it is just 'someDate:date'. The generate command lets it slide and then you end up with some hard to debug .toString() errors by when migrating.

I've added an error condition which halts the generation if any of the attributes contain an invalid DataType.

Also, I noticed that runCli() in test/support/helpers.js wasn't correctly asserting a non-zero error code so I fixed it by not passing through result.

@Georift Georift changed the title Add model:generate attribute datatype valdiation Add model:generate attribute datatype validation Aug 14, 2018
@sushantdhiman sushantdhiman merged commit 1be019f into sequelize:master Aug 19, 2018
@sushantdhiman
Copy link
Contributor

Thanks this fixed #222

codetriage-readme-bot pushed a commit to codetriage-readme-bot/cli that referenced this pull request Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants