diff --git a/server/src/models/Robot.ts b/server/src/models/Robot.ts index 8f37eb19..c348a27a 100644 --- a/server/src/models/Robot.ts +++ b/server/src/models/Robot.ts @@ -1,5 +1,6 @@ import { Model, DataTypes, Optional } from 'sequelize'; import sequelize from '../db/config'; +import Run from './Run'; interface RobotAttributes { id: string; @@ -64,4 +65,6 @@ Robot.init( } ); +Robot.hasMany(Run, { foreignKey: 'robotId' }); + export default Robot;