This commit is contained in:
syuilo 2018-10-02 00:34:37 +09:00
parent 35362ed3c7
commit f56adce51f
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
5 changed files with 8 additions and 44 deletions

View file

@ -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;