summaryrefslogtreecommitdiff
path: root/src/models/note.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/models/note.ts')
-rw-r--r--src/models/note.ts15
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() != '';
}