|
|
@ -61,6 +61,9 @@ module.exports.models = function (dc) { // dc = { orm: Sequelize对象, ORM: Seq |
|
|
|
UserResource.belongsTo(User, { foreignKey: 'userId', targetKey: 'id' }); |
|
|
|
User.hasMany(UserResource, { foreignKey: 'userId', sourceKey: 'id' }); |
|
|
|
|
|
|
|
PatrolPlan.belongsTo(PatrolTemplate, { foreignKey: 'templateId', targetKey: 'id' }); |
|
|
|
PatrolTemplate.hasMany(PatrolPlan, { foreignKey: 'templateId', sourceKey: 'id' }); |
|
|
|
|
|
|
|
PatrolTemplate.belongsTo(User, { foreignKey: 'createUserId', targetKey: 'id' }); |
|
|
|
User.hasMany(PatrolTemplate, { foreignKey: 'createUserId', sourceKey: 'id' }); |
|
|
|
|
|
|
|