From b10b62a4484557647cc4ad8f8f3f57f00f9d5e20 Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 16 Sep 2018 23:15:15 +0900 Subject: [PATCH] Fix bug --- src/models/note.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/models/note.ts b/src/models/note.ts index 62b1b3ecb..bb600fc0c 100644 --- a/src/models/note.ts +++ b/src/models/note.ts @@ -26,6 +26,21 @@ Note.createIndex({ }); export default Note; +// 後方互換性のため +Note.findOne({ + fileIds: { $exists: true } +}).then(n => { + if (n == null) { + Note.update({}, { + $rename: { + mediaIds: 'fileIds' + } + }, { + multi: true + }); + } +}); + export function isValidText(text: string): boolean { return length(text.trim()) <= 1000 && text.trim() != ''; }