|
|
@ -40,6 +40,9 @@ let model = db.define('judge_state', { |
|
|
|
pending: { type: Sequelize.BOOLEAN }, |
|
|
|
pending: { type: Sequelize.BOOLEAN }, |
|
|
|
max_memory: { type: Sequelize.INTEGER }, |
|
|
|
max_memory: { type: Sequelize.INTEGER }, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// For NOI contest
|
|
|
|
|
|
|
|
compilation: { type: Sequelize.TEXT('medium'), json: true }, |
|
|
|
|
|
|
|
|
|
|
|
result: { type: Sequelize.TEXT('medium'), json: true }, |
|
|
|
result: { type: Sequelize.TEXT('medium'), json: true }, |
|
|
|
|
|
|
|
|
|
|
|
user_id: { type: Sequelize.INTEGER }, |
|
|
|
user_id: { type: Sequelize.INTEGER }, |
|
|
@ -55,23 +58,23 @@ let model = db.define('judge_state', { |
|
|
|
type: { type: Sequelize.INTEGER }, |
|
|
|
type: { type: Sequelize.INTEGER }, |
|
|
|
type_info: { type: Sequelize.INTEGER } |
|
|
|
type_info: { type: Sequelize.INTEGER } |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
timestamps: false, |
|
|
|
timestamps: false, |
|
|
|
tableName: 'judge_state', |
|
|
|
tableName: 'judge_state', |
|
|
|
indexes: [ |
|
|
|
indexes: [ |
|
|
|
{ |
|
|
|
{ |
|
|
|
fields: ['status'], |
|
|
|
fields: ['status'], |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
fields: ['score'], |
|
|
|
fields: ['score'], |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
fields: ['user_id'], |
|
|
|
fields: ['user_id'], |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ |
|
|
|
{ |
|
|
|
fields: ['problem_id'], |
|
|
|
fields: ['problem_id'], |
|
|
|
} |
|
|
|
} |
|
|
|
] |
|
|
|
] |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
let Model = require('./common'); |
|
|
|
let Model = require('./common'); |
|
|
|
class JudgeState extends Model { |
|
|
|
class JudgeState extends Model { |
|
|
@ -200,7 +203,7 @@ class JudgeState extends Model { |
|
|
|
this.max_memory = 0; |
|
|
|
this.max_memory = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
this.pending = true; |
|
|
|
this.pending = true; |
|
|
|
this.result = { }; |
|
|
|
this.result = {}; |
|
|
|
await this.save(); |
|
|
|
await this.save(); |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
/* |
|
|
|