CakeDC/migrations — pull request #125 by Jippi (2013-05-31 20:46:26+00:00)
Title: Feature/dry run

Allows you to pass in `--dry` or `-d` to get the RAW SQL output for the intended migration run

This is nice to have if you are unsure if your migration config gives the desired result

`before` and `after` will not be called in a dry run

```
-> Console/cake Migrations.migration run up -d
Cake Migration Shell
---------------------------------------------------------------
Running migrations:

Migration will run dry, no database changes will be made

---------------------------------------------------------------
SQL for migration 1369998932_awesome_migration_name:
---------------------------------------------------------------
ALTER TABLE `db`.`table` CHANGE `col1` `col2` int(11) NOT NULL;
ALTER TABLE `db`.`table` ADD `col3` int(11) DEFAULT NULL;
---------------------------------------------------------------
All migrations have completed.
```

Help output

```
-> Console/cake Migrations.migration help
Cake Migration Shell
---------------------------------------------------------------
The Migration shell.

Usage:
cake migrations.migration [subcommand] [options]

Subcommands:

status Displays a status of all plugin and app migrations.
run Run a migration to given direction or version.
generate Generates a migration file.

To see help on a subcommand use `cake migrations.migration [subcommand] --help`

Options:

--help, -h Display this help.
--verbose, -v Enable verbose output.
--quiet, -q Enable quiet output.
--plugin, -p Plugin name to be used
--precheck, -m Precheck migrations (default:
Migrations.PrecheckException)
--force, -f Force 'generate' to compare all tables.
--connection, -c Set db config . Uses 'default' if none is
specified. (default: default)
--dry, -d Output the raw SQL queries rather than applying them
to the database.
--no-auto-init, -n Disables automatic creation of migrations table and
running any internal plugin migrations

```