server: remove fix script

pull/60/head
fantasticit 2022-05-26 10:21:59 +08:00
parent 914f7dcc00
commit 67549e3aa7
1 changed files with 1 additions and 20 deletions

View File

@ -41,26 +41,7 @@ export class WikiService {
@Inject(forwardRef(() => ViewService))
private readonly viewService: ViewService
) {
this.fixWikiData();
}
// 修正脚本
async fixWikiData() {
const wikis = await this.wikiRepo.find();
const needFixWikis = wikis.filter((wiki) => !wiki.homeDocumentId);
await Promise.all(
needFixWikis.map(async (wiki) => {
const doc = await this.documentService.findWikiHomeDocument(wiki.id);
const homeDocumentId = doc.id;
const withHomeDocumentIdWiki = await this.wikiRepo.merge(wiki, { homeDocumentId });
await this.wikiRepo.save(withHomeDocumentIdWiki);
})
);
console.log('修正完成');
}
) {}
/**
* id