When we update the database schema of a cppcms application, we may want to have an easy and safe way to
- check that the current application as the last database schema
- if not to be able to execute one or several script to update it without harming the data already in it
basically it should be an external tool that can work like this
cppcmsskel_upgradedb path/to/application/db path/to/update/folder
for example
cppcmsskel_upgradedb /opt/tatowiki/data/tatowiki.db ~/tatowiki/app/sql/updates
updates containing
- a
last_version.txt containing the last version number in it
- a list of scripts
from_X_to_Y.sql permitting to upgrade from the version X to the version Y of the database , so that the script will first compare the version in the application database, and then will execute it for example from_13_to_15.sql and from_15_to_16.sql