core: database structure update

This commit is contained in:
undefined committed 2021-09-23 18:15:17 +08:00
1 parent dca8e28361
commit 4daf8bac80
24 files changed
+182 -263

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@hydrooj/migrate-vijos",
"version": "1.5.0",
"version": "1.5.1",
"main": "package.json",
"repository": "git@github.com:hydro-dev/Hydro.git",
"author": "undefined <i@undefined.moe>",
+3 -8
View File
@@ -5,7 +5,7 @@ import {
} from 'hydrooj';
const dst = global.Hydro.service.db;
const { discussion, document } = global.Hydro.model;
const { discussion } = global.Hydro.model;
const map = {};
const pid = (id) => {
@@ -201,6 +201,7 @@ const tasks = {
userfile_usage: null,
},
record: async (doc) => {
if (doc.hidden) return null;
const testCases: TestCase[] = [];
for (const c of doc.cases || []) {
testCases.push({
@@ -227,16 +228,10 @@ const tasks = {
judgeTexts: doc.judge_texts || [],
compilerTexts: doc.compiler_texts || [],
testCases,
hidden: !!doc.hidden,
rejudged: !!doc.rejudged,
};
if (doc.rejudged) rdoc.rejudged = true;
if (doc.tid) {
rdoc.contest = {
type: doc.ttype || document.TYPE_CONTEST,
tid: doc.tid,
};
}
if (doc.tid) rdoc.contest = doc.tid;
return rdoc;
},
domain: {