title: Sequelize: Cannot set a new unique constraint message
body: <p>I am trying to setup a validation message for unique constraint violation for the fields <code>username</code> and <code>email</code>. However, whenever an already taken username is entered, it shows the message defined for the <code>email</code> property, but shows the input for the <code>username</code> property and also says that this input is for the <code>username</code> property. How would I fix this? Here is my code:</p>
  
  <pre><code>module.exports = function (sequelize, DataTypes) {
      var users = sequelize.define('users', {
          full_name: {
              type: DataTypes.STRING,
              allowNull: false,
              validate: {
                  len: {
                      args: [5, 50],
                      msg: 'Your full name may be 5 to 50 characters only.'
                  }
              }
          },
          email: {
              type: DataTypes.STRING,
              allowNull: false,
              unique: {
                  msg: 'This email is already taken.'
              },
              validate: {
                  isEmail: {
                      msg: 'Email address must be valid.'
                  }
              }
          },
          username: {
              type: DataTypes.STRING,
              allowNull: false,
              unique: {
                  msg: 'This username is already taken.'
              },
              validate: {
                  len: {
                      args: [5, 50],
                      msg: 'Your username may be 5 to 50 characters only.'
                  }
              }
          },
          password: {
              type: DataTypes.STRING,
              allowNull: false,
              validate: {
                  len: {
                      args: [5, 72],
                      msg: 'Your password may be 5 to 72 characters only.'
                  }
              }
          },
          rank: {
              type: DataTypes.INTEGER,
              allowNull: false,
              validate: {
                  isInt: true
              }
          }
      }, {
          hooks: {
              beforeValidate: function (user, options) {
                  if (typeof user.email === 'string') {
                      user.email = user.email.toLowerCase();
                  }
  
                  if (typeof user.username === 'string') {
                      user.username = user.username.toLowerCase();
                  }
              }
          }
      });
  
      return users;
  };
  </code></pre>
  
  <p>This is the output I get from input:</p>
  
  <pre><code>{
    "name": "SequelizeUniqueConstraintError",
    "message": "Validation error",
    "errors": [
      {
        "message": "This email is already taken.",
        "type": "unique violation",
        "path": "username",
        "value": "hassan"
      }
    ],
    "fields": {
      "username": "hassan"
    }
  }
  </code></pre>
  
  <p>So as you can see, it says it is the username that is not unique, but uses the message defined for the email property.</p>