Skip to content

Add model:generate attribute datatype validation - #682

Merged
sushantdhiman merged 2 commits into
sequelize:masterfrom
Georift:add-attribute-type-valdiation
Aug 19, 2018
Merged

sushantdhiman merged 2 commits into
sequelize:masterfrom
Georift:add-attribute-type-valdiation

Conversation

@Georift

@Georift Georift commented Aug 14, 2018

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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