How do we get the ENUM values of a model after defining it in Sequelize.js?
For example, we define our model as:
sequelize.define(\'model\', {
states:
The ENUM values in a schema can be found in the rawAttributes
property of the model.
var Model = sequelize.define('model', {
states: {
type: Sequelize.ENUM,
values: ['active', 'pending', 'deleted']
}
});
console.log(Model.rawAttributes.states.values);
// logs ['active', 'pending', 'deleted'] in console