I'm working on a legacy platform which is running Codeigniter 3. It's DB migration is very basic and only follows a single number to know which migration level is current and which to upgrade to. You can read more about it here: https://codeigniter.com/userguide3/libraries/migration.html
That git repo has four different environments branches which merge into each other:
development -> staging -> uat -> production
Hotfixes have started to be introduced in different environments which some require database migrations to be created. Because of this, the migration increments get thrown out of sync between the different main environments causing duplicate migration numbering and the possibility of skipping migrations that are merged up to the next branch. Even using timestamps wouldn't resolve the problem of skipping migrations.
What is a good solution to using incremental migrations systems used in CI3 to support hotfixes but also prevent duplicating migration numbers or skipping migrations?