Split database code and implement database migrations #33

Closed
opened 2020-10-24 09:09:46 +00:00 by projectmoon · 0 comments
Owner

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

  • Split code for each type of data into separate files (e.g. variables.rs)
  • Create migration code.

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.

Database code is getting larger, and we are in need of a migration facility as we settle the schema. - [x] Split code for each type of data into separate files (e.g. variables.rs) - [x] Create migration code. **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.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: projectmoon/tenebrous-dicebot#33
No description provided.