From bc9d910756a16711fe9ddb43cb0bae7057c66670 Mon Sep 17 00:00:00 2001 From: Menci Date: Fri, 26 Apr 2019 11:11:49 +0800 Subject: [PATCH] Correct table name --- models/problem.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/models/problem.ts b/models/problem.ts index c2621db..8d136ef 100644 --- a/models/problem.ts +++ b/models/problem.ts @@ -510,11 +510,11 @@ export default class Problem extends Model { const entityManager = TypeORM.getManager(); id = parseInt(id); - await entityManager.query('UPDATE `problem` SET `id` = ' + id + ' WHERE `id` = ' + this.id); - await entityManager.query('UPDATE `judge_state` SET `problem_id` = ' + id + ' WHERE `problem_id` = ' + this.id); - await entityManager.query('UPDATE `problem_tag_map` SET `problem_id` = ' + id + ' WHERE `problem_id` = ' + this.id); - await entityManager.query('UPDATE `article` SET `problem_id` = ' + id + ' WHERE `problem_id` = ' + this.id); - await entityManager.query('UPDATE `SubmissionStatictics` SET `problem_id` = ' + id + ' WHERE `problem_id` = ' + this.id); + await entityManager.query('UPDATE `problem` SET `id` = ' + id + ' WHERE `id` = ' + this.id); + await entityManager.query('UPDATE `judge_state` SET `problem_id` = ' + id + ' WHERE `problem_id` = ' + this.id); + await entityManager.query('UPDATE `problem_tag_map` SET `problem_id` = ' + id + ' WHERE `problem_id` = ' + this.id); + await entityManager.query('UPDATE `article` SET `problem_id` = ' + id + ' WHERE `problem_id` = ' + this.id); + await entityManager.query('UPDATE `submission_statictics` SET `problem_id` = ' + id + ' WHERE `problem_id` = ' + this.id); let contests = await Contest.find(); for (let contest of contests) {