Unhandled rejection SequelizeUniqueConstraintError: Validation error

后端 未结 5 540
花落未央
花落未央 2021-02-01 23:47

I\'m getting this error:

Unhandled rejection SequelizeUniqueConstraintError: Validation error

How can I fix this?

This is my models/use

5条回答
  •  失恋的感觉
    2021-02-02 00:23

    When using SQLite as a database, Sequelize (currently 5.21.5) throws SequelizeUniqueConstraintError on every constraint error, even if it has nothing to do with unique indexes. One examle would be inserting NULL into a non-nullable column. So be sure to also check for other types of errors when debugging this exception.

提交回复
热议问题