ps2alerts / stack

Creates the stack that the PS2Alerts project runs on.
https://ps2alerts.com
GNU General Public License v3.0
6 stars 1 forks source link

Added migrate-mongo based migration for adjustedBattleRank change #20

Closed ryanjsims closed 2 years ago

ryanjsims commented 2 years ago

Adds a migration that will add the adjustedBattleRank field to the database along with converting ASP from bool to number. (false -> 0, true -> 1)

Unfortunately since ASP2 was stored the same as non-ASPed players, ASP2 players will be treated as non-ASP until updated by death event.

This doesn't update the instance aggregate collection so alert history isn't updated with new values.

Also PS4 is weird for whatever reason and the asp field for PS4 characters is either null or undefined ¯\_(ツ)_/¯ so this converts those to 0

Migration usage: Usage: npm install -g migrate-mongo cd stack/mongo

Apply: DBURL="mongodb://<user>:<pass>@<host>:<port>/ps2alerts" migrate-mongo up Revert: DBURL="mongodb://<user>:<pass>@<host>:<port>/ps2alerts" migrate-mongo down