I’ve been experimenting with Migrations and data models as we work through functionality for our UF site. I’ve been using semantic versioning almost exclusively to ensure the proper sequencing of migration code runs as we iterate. Recently, though, as we lock down the MVP for our project, I thought it best to code in the dependencies for each Migration as we run them against our candidate for production release and prepare to enter alpha testing.
In doing that, I’ve encountered a behavior from Bakery Migrate that appears to me to be inconsistent with my understanding of Bakery’s capacity to sequence Migrations to meet dependencies among pending migrations in the same batch. I’m basing this on the following sentences from the Migrations docs in learning:
" If those migrations are not yet executed and are pending execution, the migrate command will take care of the order automatically. If a migration’s dependencies cannot be met, the migrate command will abort."
That being said, I tried to run several table migrations using both semantic versioning and dependency declaration attributes. And after several attempts with results that are similar to that below, I ran a single migration on which several others are dependent, ensured that it was recorded in the migrations table, ensured that its versioning is correct in dependency attributes and namespace, and Bakery Migrate STILL came back with dependency errors suggesting that several migrations could not be fulfilled due to a failure in dependency checks - even when the required dependency was both present in the semantic version directory AND recorded in the migrations table. Here’s the output from Bakery Migrate:
$ php bakery migrate --pretend -vvv
Testing database connexion
Fetching available migrations
Resolving migrations dependencies…
Checking dependencies for \UserFrosting\Sprinkle\SiteAccount\Database\Migrations\v100\SKUsTable
Some migrations dependencies can’t be met. Check those migrations for
unmet dependencies and try again:
What am I overlooking?