|
|
|
@ -616,6 +616,20 @@ const scripts: UpgradeScript[] = [
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
},
|
|
|
|
|
async function _84_85() {
|
|
|
|
|
return await iterateAllDomain(async ({ _id }) => {
|
|
|
|
|
const cursor = discussion.getMulti(_id, { parentType: document.TYPE_CONTEST });
|
|
|
|
|
for await (const ddoc of cursor) {
|
|
|
|
|
const parentId = new ObjectId(ddoc.parentId);
|
|
|
|
|
await discussion.edit(_id, ddoc.docId, { parentId });
|
|
|
|
|
try {
|
|
|
|
|
await contest.get(_id, parentId);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
await discussion.del(_id, ddoc.docId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export default scripts;
|
|
|
|
|