mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: change pdoc.content to plain text
This commit is contained in:
1 parent
ccef433c68
commit
653d18b57b
5 files changed
+17
-29
No files matched your search
@@ -253,18 +253,15 @@ const scripts: UpgradeScript[] = [
|
||||
});
|
||||
return true;
|
||||
},
|
||||
async function _16_18() {
|
||||
await iterateAllProblem(['title', 'pid'], async (pdoc) => {
|
||||
if (pdoc.domainId !== 'bzoj') return;
|
||||
if (pdoc.docId > 100000) return;
|
||||
console.log(pdoc.title, pdoc.docId, pdoc.pid);
|
||||
await problem.edit(pdoc.domainId, pdoc.docId, { docId: pdoc.docId + 100000 });
|
||||
});
|
||||
await iterateAllProblem(['pid', 'title'], async (pdoc) => {
|
||||
if (pdoc.domainId !== 'bzoj') return;
|
||||
console.log(pdoc.title, pdoc.docId, pdoc.pid);
|
||||
if (pdoc.pid.startsWith('P')) pdoc.pid = pdoc.pid.split('P')[1];
|
||||
await problem.edit(pdoc.domainId, pdoc.docId, { docId: +pdoc.pid });
|
||||
async function _16_17() {
|
||||
return true;
|
||||
},
|
||||
async function _17_18() {
|
||||
const _FRESH_INSTALL_IGNORE = 1;
|
||||
await iterateAllProblem(['content'], async (pdoc) => {
|
||||
if (typeof pdoc.content !== 'string') {
|
||||
await problem.edit(pdoc.domainId, pdoc.docId, { content: JSON.stringify(pdoc.content) });
|
||||
}
|
||||
});
|
||||
},
|
||||
];
|
||||
|
||||
Reference in new issue
Block a user