From 646626469f6bc9a6a6ae3396cb71b84255b56dc0 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Wed, 9 Oct 2024 03:31:31 +0530 Subject: [PATCH] feat: robot has many association w run --- server/src/models/Robot.ts | 3 +++ 1 file changed, 3 insertions(+) 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;