new for the Sequelize library. In my opinion, the "id" is created automatically using sequelize (and what I see in the database). However, when I move on to "creating" an object, it will throw this error:
{ [SequelizeUniqueConstraintError: Validation error]
name: 'SequelizeUniqueConstraintError',
message: 'Validation error',
errors:
[ { message: 'id must be unique',
type: 'unique violation',
path: 'id',
value: '1' } ],
fields: { id: '1' } }
Violation Code:
db.Account.create({
email: req.body.email,
password: req.body.password,
allowEmail: req.body.allowEmail,
provider: 'local',
role: 'user'
})
The notification identifier is not specified anywhere, and it is not specified in the definition of my model. Also the generated request runs fine if I run it in postgres admin:
INSERT INTO "Accounts" ("id","email","role","verifyCode","provider","cheaterScore","isBanned","allowEmail","updatedAt","createdAt") VALUES (DEFAULT,'cat69232@gmail.com','user','','local',0,false,false,'2016-01-27 04:31:54.350 +00:00','2016-01-27 04:31:54.350 +00:00') RETURNING *;
Any ideas on what I'm missing here?
edit:
postgres version: 9.5 stack trace starts here: / node_modules / sequelize / lib / dialects / postgres / query.js: 326