Automatically update the database when a new patch level is required

We don't automatically downgrade the database for previous patch
levels since that could be dangerous. Instead, any reverse patches
should be applied manually.