const UserRole = sequelize.define(
'user_role',
{
user_id: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: User,
key: 'id'
}
},
role_id: {
type: Sequelize.INTEGER,
allowNull: false,
references: {
model: Role,
key: 'id'
}
}
},
{
identifier: false,
timestamps: false,
indexes: [
{
primaryKey: true,
fields: ['user_id', 'role_id']
}
]
}
);