summaryrefslogtreecommitdiff
path: root/tools/migration/shell.1489951459.like-to-reactions.js
blob: 962a0f00ef41ebea2fa445cff5d3300ee1aeaeef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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({})