Skip to content

Instantly share code, notes, and snippets.

@THEozmic
Created March 27, 2019 04:14
Show Gist options
  • Save THEozmic/9a0276031bbcbee178b54ea6e1072834 to your computer and use it in GitHub Desktop.
Save THEozmic/9a0276031bbcbee178b54ea6e1072834 to your computer and use it in GitHub Desktop.
export default (sequelize, DataTypes) => {
const GroupUsers = sequelize.define('GroupUsers', {
userId: {
type: DataTypes.INTEGER,
allowNull: false,
references: {
model: 'Users',
key: 'id'
}
},
groupId: {
type: DataTypes.INTEGER,
allowNull: false,
references: {
model: 'Groups',
key: 'id'
}
}
});
return GroupUsers;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment