'Sequelize unique custom message

When I try to define a custom message, the default message Validation error still appears.

The unique property accepts either a boolean or an object whit properties name and msg. What does name mean? Why don't I see the message in msg?

sequelize: 6.16.1

Thank you

   idcustomer: {
      type: DataTypes.STRING(255),
      allowNull: false,
      primaryKey: true,
      unique: {
        name: 'idcustomer',
        msg: 'idcustomer duplicate',
      },
      validate: {
        notEmpty: {
          msg: RequiredFieldMessage('Id Customer'),
        },
      },
    },


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source