How to generate query on join table using Sequelize?
问题 Let us say there are two tables namely User and User Role. The relationship between user and user role is one to many. Sequelize model for the user is as following - const user = sequelize.define( 'user', { id: { type: DataTypes.BIGINT, allowNull: false, primaryKey: true, autoIncrement: true, field: 'id' }, userName: { type: DataTypes.STRING(200), allowNull: false, field: 'username' }, password: { type: DataTypes.STRING(200), allowNull: false, field: 'password' } }, { tableName: 'user' } );