diff --git a/server/src/models/associations.ts b/server/src/models/associations.ts new file mode 100644 index 00000000..50c22834 --- /dev/null +++ b/server/src/models/associations.ts @@ -0,0 +1,7 @@ +import Robot from './Robot'; +import Run from './Run'; + +export default function setupAssociations() { + Run.belongsTo(Robot, { foreignKey: 'robotId' }); + Robot.hasMany(Run, { foreignKey: 'robotId' }); +}