How to add a custom DataType in Sequelize ORM
问题 I want to define a custom data type in Sequelize by inheriting all default behaviours of existing DataType.Integer . The base idea here is to define a new type and override valueOf and toString methods. The Sequelize docs doesn't contain any information related to this topic. It would be really nice if someone can help me on this. 回答1: https://github.com/sequelize/sequelize/blob/master/lib/data-types.js holds the sequelize data types. Specifically, https://github.com/sequelize/sequelize/blob