mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix upgrade
This commit is contained in:
1 parent
b833efc8c9
commit
1b0bf4c37f
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.20.47",
|
"version": "2.20.48",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "dist/loader.js",
|
"main": "dist/loader.js",
|
||||||
"typings": "dist/loader.d.ts",
|
"typings": "dist/loader.d.ts",
|
||||||
|
|||||||
@@ -236,9 +236,9 @@ const scripts: UpgradeScript[] = [
|
|||||||
const _FRESH_INSTALL_IGNORE = 1;
|
const _FRESH_INSTALL_IGNORE = 1;
|
||||||
await iterateAllProblem(['data', 'additional_file'], async (pdoc) => {
|
await iterateAllProblem(['data', 'additional_file'], async (pdoc) => {
|
||||||
const $set: any = {};
|
const $set: any = {};
|
||||||
const td = pdoc.data.filter((f) => f.name);
|
const td = (pdoc.data || []).filter((f) => !!f.name);
|
||||||
if (JSON.stringify(td) !== JSON.stringify(pdoc.data)) $set.data = td;
|
if (JSON.stringify(td) !== JSON.stringify(pdoc.data)) $set.data = td;
|
||||||
const af = pdoc.additional_file.filter((f) => f.name);
|
const af = (pdoc.additional_file || []).filter((f) => !!f.name);
|
||||||
if (JSON.stringify(af) !== JSON.stringify(pdoc.additional_file)) $set.additional_file = af;
|
if (JSON.stringify(af) !== JSON.stringify(pdoc.additional_file)) $set.additional_file = af;
|
||||||
if (Object.keys($set).length) await problem.edit(pdoc.domainId, pdoc.docId, $set);
|
if (Object.keys($set).length) await problem.edit(pdoc.domainId, pdoc.docId, $set);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user