image

Sascha Depold

Engineering Manager

Blog

Greetings! Not sure if this is the best place to ask, but I've got a sequelize question for you: is there a way to define something like a custom...

Hi!

For now it is not possible to add a special data type. But you could use the boolean datatype for the ‘sex’-attribute and add a gender method which evaluates the attribute and returns ‘male’ or ‘female’ as value. Take a look at http://sequelizejs.com/?active=expanding-models#expanding-models and http://sequelizejs.com/?active=data-types#data-types for further information. What do you think?

With best regards,

Sascha