9.0.0
This commit is contained in:
@ -27,21 +27,6 @@ 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() != '';
|
||||
}
|
||||
|
@ -3,11 +3,6 @@ import db from '../db/mongodb';
|
||||
|
||||
const Stats = db.get<IStats>('stats');
|
||||
|
||||
// 後方互換性のため
|
||||
Stats.dropIndex({ date: -1 } as any).catch((e: mongo.MongoError) => {
|
||||
if (e.code !== 27) throw e;
|
||||
});
|
||||
|
||||
Stats.createIndex({ span: -1, date: -1 }, { unique: true });
|
||||
export default Stats;
|
||||
|
||||
|
@ -35,28 +35,6 @@ User.createIndex('uri', { sparse: true, unique: true });
|
||||
|
||||
export default User;
|
||||
|
||||
// 後方互換性のため
|
||||
User.findOne({
|
||||
pinnedNoteId: { $exists: true }
|
||||
}).then(async x => {
|
||||
if (x == null) return;
|
||||
|
||||
const users = await User.find({
|
||||
pinnedNoteId: { $exists: true }
|
||||
});
|
||||
|
||||
users.forEach(u => {
|
||||
User.update({ _id: u._id }, {
|
||||
$set: {
|
||||
pinnedNoteIds: [(u as any).pinnedNoteId]
|
||||
},
|
||||
$unset: {
|
||||
pinnedNoteId: ''
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
type IUserBase = {
|
||||
_id: mongo.ObjectID;
|
||||
createdAt: Date;
|
||||
|
Reference in New Issue
Block a user