Closed
Description
Why
Implement a minimum node database version verification when running a database migration (useful with squash migration).
If the current database version is strictly below the squashed version, it means that the previous migrations done incrementally must be applied (and they are available only in the previous versions of the node) as the squashed version can not be applied as is. A minimum version of the node to play the update sequentially should be returned to the user in that case.
What
Implement a minimum version of the node needed when there is a gap between the last version of the database and the next version to be played (which is squashed).
How
- Label squashed versions in the database migration tool
- Detect a conflict if there is a gap between the versions (current and next to be applied which is squashed)
- Display an error message with a minimum node version compatible to run the migrations sequentially (stop the node prior to running the migration fix)
- Adapt the migrations for:
- aggregator (2 migrations)
-
signer (2 migrations)
- Add a
database
command with anmigrate
sub-command:- With a store directory parameter
- Run the migration on all the databases of the node
- In aggregator
- In signer