rename with execution order, add desc & initial creation script
This commit is contained in:
parent
12d815dc42
commit
04dd2cb12b
8 changed files with 40 additions and 0 deletions
22
tools/migration/shell.1489951459.like-to-reactions.js
Normal file
22
tools/migration/shell.1489951459.like-to-reactions.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
db.users.update({}, {
|
||||
$unset: {
|
||||
likes_count: 1,
|
||||
liked_count: 1
|
||||
}
|
||||
}, false, true)
|
||||
|
||||
db.likes.renameCollection('post_reactions')
|
||||
|
||||
db.post_reactions.update({}, {
|
||||
$set: {
|
||||
reaction: 'like'
|
||||
}
|
||||
}, false, true)
|
||||
|
||||
db.posts.update({}, {
|
||||
$rename: {
|
||||
likes_count: 'reaction_counts.like'
|
||||
}
|
||||
}, false, true);
|
||||
|
||||
db.notifications.remove({})
|
||||
Loading…
Add table
Add a link
Reference in a new issue