...
This module automatically keeps the database up to date with help of SQL files which are tracked by this module.
Therefore, if the SQL files are tracked with a VCS, the database level is bound to the VCS revision.
...
Your database migration files need to have an ascending order regarding their file names.
The reason for this is that it is assumed that your migration files build up on their ancestors.
New migration files therefore need to have a lower sorting than old ones.
Else they will be ignored. For example, a meaningful file name scheme would be:
...
The database migration will keep track of which migration files were executed, and how many SQL statements of
each file were executed. The statistics are saved to the database itself into __database_migration
.
...
The behavior described above brings a problem when you are working with several branches and add migration files in
parallel.
If you have already run the last migration update of your branch, the migration file that was created first in
another branch will be ignored. Like so:
...
The database migration module will check the last migration file for new statements - even if it was already executed.
This is a handy feature if you are a developer and want to add SQL statements to your last migration file which is not
yet committed in your VCS.
...
Additionally, you may want to add DatabaseMigrationController::runUpdate();
to your bootstrapTests.php too, so
that your test database gets migrated as well.
...
If there is an Update.php in your project - especially for Docker projects - it is recommended to put the update command
right into the Update.php. This way, migration updates are checked/run whenever the docker container gets startet. This has the benefit of not
slowing down your website.
...
Please make sure your SQL statements are as generic as can be, so that your customer database and your test database
can get migrated without problems.
...