2
4

1 回答 1

1

There's an option for that

--yes, -y Do not prompt for confirmation. Be careful!

-> app/Console/cake schema update --help

Welcome to CakePHP v2.8.0-dev Console
---------------------------------------------------------------
App : app
Path: /var/www/someapp.dev/
---------------------------------------------------------------
Usage:
cake schema update [options]

Options:

--help, -h        Display this help.
--verbose, -v     Enable verbose output.
--quiet, -q       Enable quiet output.
--plugin, -p      The plugin to use.
--path            Path to read and write schema.php (default:
                  /var/www/someapp.dev/app/Config/Schema)
--file            File name to read and write.
--name            Classname to use. If its Plugin.class, both name and
                  plugin options will be set.
--connection, -c  Set the db config to use. (default:
                  default)
--dry             Perform a dry run on create and update commands.
                  Queries will be output instead of run.
--snapshot, -s    Snapshot number to use/make.
--force, -f       Force "generate" to create a new schema
--yes, -y         Do not prompt for confirmation. Be careful!

However the yes option wasn't added until 2.5 - if you're using an earlier version of 2.x, you'll need to upgrade to have this option available.

于 2015-07-26T15:53:12.717 回答