core: fix oauth id

This commit is contained in:
undefined committed 2025-04-29 12:04:04 +08:00
1 parent 401bb505c2
commit 0f7961d675
4 files changed
+15 -3

No files matched your search

+12
View File
@@ -603,4 +603,16 @@ export const coreScripts: MigrationScript[] = [
});
return true;
},
async function _93_94(ctx) {
await ctx.inject(['oauth'], async (c) => {
await c.oauth.coll.deleteMany({ _id: { $type: 'string' } });
const docs = await c.oauth.coll.find({ id: { $type: 'number' as any } }).toArray();
const op = c.oauth.coll.initializeUnorderedBulkOp();
for (const doc of docs) {
op.find({ _id: doc._id }).updateOne({ id: doc.id.toString() });
}
if (op.length) await op.execute();
});
return true;
},
];