exp:expmigrationdryrun
Dry run of the pending migrations: the plan, and with --simulate a run in a transaction that is rolled back (--diff shows what changed).
Script bin/php/expmigrationdryrun.php, code in kernel/private/classes/commands/expmigrationdryrun.php. Run it from the installation root, as the user the web server runs as:
./console exp:expmigrationdryrun --help
./console exp:migration:dry-run --help
php bin/php/expmigrationdryrun.php --helpHelp text
Dry run of the pending migrations
exp:migration:migrate without --apply: every pending migration with what it would change, the
checksum guard and the check of the code trees, nothing written. --simulate runs the migrations with
up() in one transaction that is rolled back at the end, under the installation lock, where the
database undoes schema changes too (PostgreSQL, SQLite; elsewhere the plan is listed with a warning).
--diff adds what each migration changed: tables and columns added or dropped, rows per table. Files,
caches and the search index a migration writes are not undone by the rollback.
./console exp:migration:dry-run
./console exp:migration:dry-run --simulate --diff
./console exp:migration:dry-run --only=20261031120000_add_news_class --format=jsonOptions
| Option | Value | Help |
|---|---|---|
--only | required | Only these migrations (migration ids, a comma list or repeated) |
--path | required | Migration files or folders, relative to the root or absolute (a comma list or repeated): migrate and dry-run take only the migrations in them, check checks them instead of the migration directories |
--environment | required | The environment (default the installation's: [AdminEnvironment] Level, or EXP_ENV with Level=auto; check: every environment); only the migrations for it count |
--format | required | text (default) or json (the machine output exp-migration/1) |
--login | required | Run as this user (default: [RunSettings] RunAsUser of migration.ini) |
--diff | With --simulate: what each migration changed in the database (tables, columns, rows) | |
--simulate | Run the migrations in a transaction that is rolled back (PostgreSQL and SQLite; elsewhere the plan is listed) |
Read from the option definitions in the code (startup(), getOptions(), options() or ezcConsoleOption). Every script also takes the standard options of the script framework (--help, --siteaccess, --debug, --quiet, --allow-root-user ...).
Related
Generated by ./console exp:help:examples from bin/php/expmigrationdryrun.php, kernel/private/classes/commands/expmigrationdryrun.php. Do not edit this page: change the source and generate again (how). Free documentation: GFDL 1.3 or later.