ProjectMoon / matrix-dicebot

This repository is mirrored from: https://git.agnos.is/projectmoon/matrix-dicebot
https://git.agnos.is/projectmoon/matrix-dicebot
Other
4 stars 1 forks source link

Split database code and implement database migrations #33

Closed ProjectMoon closed 4 years ago

ProjectMoon commented 4 years ago

Database code is getting larger, and we are in need of a migration facility as we settle the schema.

Migration Code

Store the current migration version in a specific migration tree as a single number. Hardcode the current database version into the binary (because embedded database and laziness). Produce a range of migration numbers to run on startup, which would be all versions between the old and current version, and including the current version. Migrations are functions that receive the Database object.