"Creation Failed: ID Must Be Unique" Error

I am trying to add an entry to a table. Forest should be auto-creating the unique ID everytime you add a new entry to a table.

Screenshot 2020-10-14 at 2.03.46 PM

Actual behavior

Instead, Forest will not allow me to create the entry and shows an “ID Must Be Unique” error.

Failure Logs

Please include any relevant log snippets, if necessary.


Please provide any relevant information about your setup.

  • Package Version:
  • Express Version:
  • Sequelize Version:
  • Database Dialect:
  • Database Version:
  • Project Name:

Hi @kristina :wave: Thank you for your feedback.

What database dialect do you use? (PostgreSQL, MySQL, MongoDB, MSSQL)

There may be a problem with the id field definition. Could you please share your code model (only the relevant part, e.g: the id field definition, and configuration at the end of the file)? Could you also share the CREATE TABLE definition, assuming you use a SQL dialect? (also, just keep the relevant part, to avoid sharing publically sensitive information).

If you use SQL dialect, is your field a serial ID (also known as auto-increment) or an UUID? Assuming you use UUID and an SQL dialect, you could try to define your field as follow:

id: {
  type: DataTypes.UUID,
  primaryKey: true,
  defaultValue: Sequelize.literal('gen_random_uuid()')
1 Like