sdepold/sequelize — pull request #375 by adamsch1 (2012-12-18 01:11:14+00:00)
Title: MInor:  Clearer error if you have a typo on the column data type

I had this in a table definition and it took me a while to figure out the error from the original stack trace:

activity_date: Sequelize.DATEd, // Note the lower case extra d

Before the error was:

/home/shane/slurp/node_modules/sequelize/lib/dao-factory.js:52
if((attributeName != 'id') && (dataTypeString.indexOf('PRIMARY KEY') !==
^
TypeError: Cannot call method 'indexOf' of undefined

Now if you do that it will throw a clearer exception:

/home/shane/slurp/node_modules/sequelize/lib/dao-factory.js:53
if( dataTypeString === undefined ) throw new Error("Unrecognized data ty
^
Error: Unrecognized data type for field activity_date