{"size": 1166, "ext": "js", "max_stars_repo_path": "server/models/user.js", "max_stars_repo_name": "freshcarton/freshcarton", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "server/models/user.js", "max_issues_repo_name": "freshcarton/freshcarton", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "server/models/user.js", "max_forks_repo_name": "freshcarton/freshcarton", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.15, "max_line_length": 129, "alphanum_fraction": 0.56432247}
'use strict';
module.exports = function(sequelize, DataTypes) {
  var User = sequelize.define('User', {
      id: {
          allowNull: false,
          autoIncrement: true,
          primaryKey: true,
          type: DataTypes.INTEGER
      },
      email:{
          type:DataTypes.TEXT,
          allowNull: false
      },      
      hashkey:{
          type:DataTypes.TEXT,
          allowNull: false
      },
      parentType:{
          type: DataTypes.TEXT,
          allowNull: false
      },
      parentId:{
          type: DataTypes.INTEGER,
          allowNull: false
      },
      authkey:{
          type: DataTypes.TEXT,
          allowNull: false          
      }
  }, {
    classMethods: {
      associate: function(models) {
          User.belongsTo(models.Employee,{onDelete: 'cascade', hooks: true,foreignKey: 'parentId' , foreignKeyConstraint:true });
          User.belongsTo(models.Vendor,{onDelete: 'cascade', hooks: true,foreignKey: 'parentId' , foreignKeyConstraint:true });
		  User.belongsTo(models.Customer,{onDelete: 'cascade', hooks: true,foreignKey: 'parentId' , foreignKeyConstraint:true });
      }
    }
  });
  return User;
};