Started adding results

This commit is contained in:
2024-02-24 01:34:32 -05:00
parent 65fc2b753b
commit 6761aaa413
5 changed files with 122 additions and 6 deletions

View File

@ -8,6 +8,7 @@ const sequelize = new Sequelize({
const Hardware = require('./hardware')(sequelize);
const Benchmark = require('./benchmark')(sequelize);
const Test = require('./test')(sequelize);
const Result = require('./result')(sequelize);
// Hardware/Test one-to-many
Hardware.hasMany(Test);
@ -17,4 +18,12 @@ Test.belongsTo(Hardware);
Benchmark.belongsToMany(Test, { through: 'tests_benchmarks' });
Test.belongsToMany(Benchmark, { through: 'tests_benchmarks' });
// Result/Benchmark many-to-one
Result.belongsTo(Benchmark);
Benchmark.hasMany(Result);
// Result/Test many-to-one
Result.belongsTo(Test);
Test.hasMany(Result);
module.exports = sequelize;