/* eslint-disable*/ 'use strict'; module.exports = dc => { const DataTypes = dc.ORM; const sequelize = dc.orm; const UserRole = sequelize.define("userRole", { id: { type: DataTypes.INTEGER, allowNull: false, defaultValue: null, comment: null, primaryKey: true, field: "id", autoIncrement: true }, roleId: { type: DataTypes.INTEGER, allowNull: true, defaultValue: null, comment: "角色id", primaryKey: false, field: "role_id", autoIncrement: false }, userId: { type: DataTypes.INTEGER, allowNull: true, defaultValue: null, comment: "用户id", primaryKey: false, field: "user_id", autoIncrement: false } }, { tableName: "user_role", comment: "", indexes: [] }); dc.models.UserRole = UserRole; const Role = dc.models.Role; UserRole.belongsTo(Role, { foreignKey: 'roleId', targetKey: 'id' }); Role.hasMany(UserRole, { foreignKey: 'roleId', sourceKey: 'id' }); return UserRole; };