diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-09-16 23:15:15 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-09-16 23:15:15 +0900 |
| commit | dc2055f5bce505ef3040527b5f5fcde541cd1496 (patch) | |
| tree | 1fc19ce75e429389bcd6262db2580cd40c7bac17 /src/models | |
| parent | Add mentions column (Deck) (diff) | |
| download | sharkey-dc2055f5bce505ef3040527b5f5fcde541cd1496.tar.gz sharkey-dc2055f5bce505ef3040527b5f5fcde541cd1496.tar.bz2 sharkey-dc2055f5bce505ef3040527b5f5fcde541cd1496.zip | |
Fix bug
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/note.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/models/note.ts b/src/models/note.ts index 62b1b3ecb1..bb600fc0cb 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() != ''; } |