discord-diabetes / diabot

A diabetes-oriented chatbot for Discord
https://discord.gg/diabetes
Other
21 stars 13 forks source link

Add database migration system (via Mongock) #138

Closed p5nbTgip0r closed 3 years ago

p5nbTgip0r commented 3 years ago

This PR is based off of #137, so don't merge this until that PR is merged.

Adds a database migration system to Diabot using Mongock. Closes #133.

The Redis migration functionality wasn't tested since I frankly don't have any Diabot Redis data to test it on, but theoretically everything should work with it. The logic behind it was kept the same, but I converted it to be synchronous in order to work with Mongock as it doesn't support reactive/async code right now, and I also converted it from the old migration system over to Mongock.

I didn't bother using Mongock's legacy migration feature because our old migration system didn't keep track of applied migrations anywhere in the database.