var Model = sequelize.define('Company', {
name: {
type: DataTypes.STRING,
unique: true
}
}
In the above example, unique: true is case sensitive. It allows both "sample" and "Sample" to be saved in the db. Is there a built-in way to do this in sequelize without having to write a custom validator?
I'd suggest adding a functional unique index as seen here: http://www.postgresql.org/message-id/[email protected]