Just a note to anybody else who ends up scratching their head on this one.
Was getting the following
ame: 'SequelizeUniqueConstraintError',
message: 'Validation error',
errors:
[ { message: 'PRIMARY must be unique',
type: 'unique violation',
path: 'PRIMARY',
value: '0' } ],
fields: { PRIMARY: '0' } }
DESPITE the fact that my table was setup with an auto_increment id field (normally this is the problem for most people).
Sequelize was auto-generating an INSERT query with the id field set to value DEFAULT. Apparently DEFAULT means 0 to MySQL, and 0 (when that sql_mode is on) does not trigger an autoincrement.
I understand that this setting is on for my server for security reasons, so not sure whether or not there is a change that could be implemented in the ORM to avoid this... like I said, just a heads up.
Just a note to anybody else who ends up scratching their head on this one.
Was getting the following
ame: 'SequelizeUniqueConstraintError',
message: 'Validation error',
errors:
[ { message: 'PRIMARY must be unique',
type: 'unique violation',
path: 'PRIMARY',
value: '0' } ],
fields: { PRIMARY: '0' } }
DESPITE the fact that my table was setup with an auto_increment id field (normally this is the problem for most people).
Sequelize was auto-generating an INSERT query with the id field set to value DEFAULT. Apparently DEFAULT means 0 to MySQL, and 0 (when that sql_mode is on) does not trigger an autoincrement.
I understand that this setting is on for my server for security reasons, so not sure whether or not there is a change that could be implemented in the ORM to avoid this... like I said, just a heads up.