Skip to content
This repository has been archived by the owner on Oct 5, 2023. It is now read-only.

Commit

Permalink
chore: エラーを無視するように
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Sep 30, 2023
1 parent a6af122 commit 87910c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/migration/NoteReaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,17 @@ export async function migrateNoteReaction(

await createUser({userId: noteReaction.userId});
await migrateNote(noteReaction.noteId)
try {
await noteReactionRepository.save({
id: noteReaction.id,
createdAt: noteReaction.createdAt,
userId: noteReaction.userId,
noteId: noteReaction.noteId,
reaction: noteReaction.reaction
});
} catch (e) {
logger.warn(`NoteReaction: ${noteReaction.id} は既に移行済みでした`)
}
logger.succ(`NoteReaction: ${noteReaction.id} の移行が完了しました`);

}
Expand Down
5 changes: 4 additions & 1 deletion src/migration/note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export async function migrateNote(noteId: string, useNote?: Note) {
const isExists = await noteRepository.findOne({where: {id: note.id}}) === undefined ? false : true

if (isExists) return;

try {
await noteRepository.save({
id: note.id,
createdAt: note.createdAt,
Expand Down Expand Up @@ -52,6 +52,9 @@ export async function migrateNote(noteId: string, useNote?: Note) {
renoteUserId: note.renoteId,
renoteUserHost: note.renoteUserHost,
});
} catch (e) {
logger.warn(`Note: ${note.id} は既に移行済みでした`);
}
await migrateNoteReactions(originalDb, nextDb, note.id);
await migrateNoteUnreads(originalDb, nextDb, note.id);
await migrateNoteFavorites(note.id);
Expand Down

0 comments on commit 87910c3

Please sign in to comment.