|
|
@ -22,6 +22,7 @@ |
|
|
|
let Sequelize = require('sequelize'); |
|
|
|
let Sequelize = require('sequelize'); |
|
|
|
let db = syzoj.db; |
|
|
|
let db = syzoj.db; |
|
|
|
const User = syzoj.model('user'); |
|
|
|
const User = syzoj.model('user'); |
|
|
|
|
|
|
|
const Contest = syzoj.model('contest'); |
|
|
|
|
|
|
|
|
|
|
|
let model = db.define('rating_calculation', { |
|
|
|
let model = db.define('rating_calculation', { |
|
|
|
id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true }, |
|
|
|
id: { type: Sequelize.INTEGER, primaryKey: true, autoIncrement: true }, |
|
|
@ -53,6 +54,10 @@ class RatingCalculation extends Model { |
|
|
|
return newItem; |
|
|
|
return newItem; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async loadRelationShips() { |
|
|
|
|
|
|
|
this.contest = await Contest.fromID(this.contest_id); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
getModel() { return model; } |
|
|
|
getModel() { return model; } |
|
|
|
|
|
|
|
|
|
|
|
async delete() { |
|
|
|
async delete() { |
|
|
|