wars2k / booktracker

Selfhosted app for organizing your library and tracking your reading habits.
MIT License
45 stars 1 forks source link

Upgrade Scripts #26

Closed wars2k closed 11 months ago

wars2k commented 11 months ago

This pull request merges upgrade-scripts branch into develop.

upgrade-scripts introduces the concept of "upgrades" into Booktracker, which are bits of code that run one time after an update as a way to ensure the database is up to date for new functionality introduced in each update.

For example, an upcoming Booktracker release will introduce functionality to track authors. This will require a change to the books table in the SQLite database as well as an update to all existing rows within it. The change will be reflected in the init.sql file that new users will run when the database first initializes, but an upgrade script will ensure that the table for existing users will also undergo the necessary change for this new feature.

On the client side, upgrade scripts are seen by users with admin privileges from the Settings page. Users can view the logs generated by the update, find the path to the automatic database backup, and more from a detailed Upgrade Details page.