'use strict';

module.exports = function(sequelize, DataTypes) {

    var User = sequelize.define('User', {

        firstname: DataTypes.STRING,
        lastname: DataTypes.STRING,
        username: {
            type: DataTypes.STRING,
            unique: true,
        },
        password: DataTypes.STRING,
        role: DataTypes.STRING,
        mobile: DataTypes.STRING,
        email: {
            type: DataTypes.STRING,
            unique: true,
        },
        title: DataTypes.STRING,
        work_email: DataTypes.STRING,
        isActive: DataTypes.BOOLEAN,
        lang: DataTypes.STRING,
        designation: DataTypes.STRING,
        phone_alternate : DataTypes.STRING,
        middlename : DataTypes.STRING,
        google_account: DataTypes.STRING,
        type :  DataTypes.STRING,
        scope:  DataTypes.STRING,
        colorblind: DataTypes.BOOLEAN,
        deactivated: DataTypes.BOOLEAN,
        super_token: DataTypes.STRING,
        reset_password_token: DataTypes.STRING,
        reset_password_expires: DataTypes.DATE
    }, {
        tableName: 'users',
        timestamps: true,
        underscored: true,
        classMethods: {
            associate: function(models) {
                User.hasMany(models.user_regions);
            }
        }
    });

    return User;
};

@@ -389,81 +389,24 @@
 il: 
-%7B%0A            type: DataTypes.STRING,%0A            unique: true,%0A        %7D
+DataTypes.STRING
 ,%0A  

Update users model -- email doesn't need to be unique. db table updated as well