You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
589 B

6 years ago
import * as TypeORM from "typeorm";
import Model from "./common";
declare var syzoj: any;
import User from "./user";
@TypeORM.Entity()
export default class RatingHistory extends Model {
@TypeORM.PrimaryColumn({ type: "integer" })
6 years ago
rating_calculation_id: number;
@TypeORM.PrimaryColumn({ type: "integer" })
6 years ago
user_id: number;
@TypeORM.Column({ nullable: true, type: "integer" })
rating_after: number;
@TypeORM.Column({ nullable: true, type: "integer" })
rank: number;
user: User;
async loadRelationships() {
this.user = await User.findById(this.user_id);
}
}