Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save shimomura1004/2792357 to your computer and use it in GitHub Desktop.
Save shimomura1004/2792357 to your computer and use it in GitHub Desktop.
migration script for asakusasatellite v0.7.0 or older
db.messages.update({}, {$unset : { updated_at : 1 }}, false, true)
db.messages.update({}, {$unset : { room : 1 }}, false, true)
db.messages.update({}, {$rename : { "user._id" : "user_id" }}, false, true)
db.messages.update({}, {$unset : { user : 1 }}, false, true)
db.messages.dropIndex({created_at:-1})
db.repairDatabase()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment