Migrations
Doctrine-backed Vortos migrations, module schema providers, drift detection, adoption, and production deployment rules.
Migrations
Vortos migrations are built on Doctrine Migrations and use the shared DBAL connection.
The framework adds module-aware behavior on top:
- framework modules can ship structured DBAL schema providers
vortos:migrate:publishpublishes module schema into app migration classes.vortos-published.jsonrecords source, owning module, checksum, tables, and indexesvortos:migrate:statusreports pending/migrated state and schema driftvortos:migrateruns preflight before executing SQLvortos:migrate:adoptmarks verified existing schema as executed- PostgreSQL advisory locking prevents concurrent migration runners
Commands
php vortos migrate:publish
php vortos migrate:status
php vortos migrate
php vortos migrate:adopt Version20260505114121 --verify
php vortos migrate:rollback --steps=1
php vortos migrate:fresh --force
php vortos migrate:analyze # lock-safety CI gate — see Lock-Safety Analysis
php vortos migrate:down-verify # prove every migration's down() actually worksmigrate:fresh is blocked in prod. See Lock-Safety Analysis & Down-Verify for what migrate:analyze and migrate:down-verify actually check.
Publish is resilient and DB-free
migrate:publish converts module SQL stubs and schema providers into Doctrine migration classes without a live database — it runs against a fresh in-memory Schema, so no Postgres is needed in a clean CI/build step. It is also resilient: a single malformed stub can no longer abort the whole run and starve other packages' migrations — the offending stub is reported and the rest still publish (the command exits non-zero so CI still fails). Alter-style schema providers must guard table access with if ($schema->hasTable($this->t('...'))) since publish introspects on an empty schema.
Tracking
Doctrine tracks executed migrations in:
vortos_migrationsVortos tracks module publish metadata in:
migrations/.vortos-published.jsonThe Doctrine table answers "did this migration run?". The Vortos manifest answers "which module migration source produced this migration and which schema objects does it own?".