Skip to content

Instantly share code, notes, and snippets.

@Eth3rnit3
Created November 28, 2018 10:30
Show Gist options
  • Save Eth3rnit3/cb0f87d03657f30b2e623b88c8679659 to your computer and use it in GitHub Desktop.
Save Eth3rnit3/cb0f87d03657f30b2e623b88c8679659 to your computer and use it in GitHub Desktop.
'use strict';
module.exports = (sequelize, DataTypes) => {
const User = sequelize.define('User', {
email: DataTypes.STRING,
firstName: DataTypes.STRING,
lastName: DataTypes.STRING,
companyId: DataTypes.INTEGER
}, {});
User.associate = function(models) {
User.belongsTo(models.Company, {foreignKey: 'companyId', as: 'company'})
};
return User;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment