Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updating help() for Schema shell.
  • Loading branch information
markstory committed Oct 4, 2009
1 parent 0b6d6ce commit 76a88fc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 13 deletions.
50 changes: 37 additions & 13 deletions cake/console/libs/schema.php
Expand Up @@ -437,20 +437,44 @@ function help() {
$this->out("Usage: cake schema <command> <arg1> <arg2>...");
$this->hr();
$this->out('Params:');
$this->out("\n\t-connection <config>\n\t\tset db config <config>. uses 'default' if none is specified");
$this->out("\n\t-path <dir>\n\t\tpath <dir> to read and write schema.php.\n\t\tdefault path: ". $this->Schema->path);
$this->out("\n\t-name <name>\n\t\tclassname to use.");
$this->out("\n\t-file <name>\n\t\tfile <name> to read and write.\n\t\tdefault file: ". $this->Schema->file);
$this->out("\n\t-s <number>\n\t\tsnapshot <number> to use for run.");
$this->out("\n\t-dry\n\t\tPerform a dry run on 'run' commands.\n\t\tQueries will be output to window instead of executed.");
$this->out("\n\t-f\n\t\tforce 'generate' to create a new schema.");
$this->out();
$this->out("\t-connection <config>");
$this->out("\t\tset db config <config>. uses 'default' if none is specified");
$this->out();
$this->out("\t-path <dir>");
$this->out("\t\tpath <dir> to read and write schema.php.");
$this->out("\t\tdefault path: ". $this->Schema->path);
$this->out();
$this->out("\t-name <name>");
$this->out("\t\tclassname to use.");
$this->out();
$this->out("\t-file <name>");
$this->out("\t\tfile <name> to read and write.");
$this->out("\t\tdefault file: ". $this->Schema->file);
$this->out();
$this->out("\t-s <number>");
$this->out("\t\tsnapshot <number> to use for run.");
$this->out();
$this->out("\t-dry");
$this->out("\t\tPerform a dry run on 'run' commands.");
$this->out("\t\tQueries will be output to window instead of executed.");
$this->out();
$this->out("\t-f");
$this->out("\t\tforce 'generate' to create a new schema.");
$this->out();
$this->out('Commands:');
$this->out("\n\tschema help\n\t\tshows this help message.");
$this->out("\n\tschema view\n\t\tread and output contents of schema file");
$this->out("\n\tschema generate\n\t\treads from 'connection' writes to 'path'\n\t\tTo force generation of all tables into the schema, use the -f param.\n\t\tUse 'schema generate snapshot <number>' to generate snapshots\n\t\twhich you can use with the -s parameter in the other operations.");
$this->out("\n\tschema dump <filename>\n\t\tDump database sql based on schema file to <filename>. \n\t\tIf <filename> is write, schema dump will be written to a file\n\t\tthat has the same name as the app directory.");
$this->out("\n\tschema run create <schema> <table>\n\t\tDrop and create tables based on schema file\n\t\toptional <schema> arg for selecting schema name\n\t\toptional <table> arg for creating only one table\n\t\tpass the -s param with a number to use a snapshot\n\t\tTo see the changes, perform a dry run with the -dry param");
$this->out("\n\tschema run update <schema> <table>\n\t\talter tables based on schema file\n\t\toptional <schema> arg for selecting schema name.\n\t\toptional <table> arg for altering only one table.\n\t\tTo use a snapshot, pass the -s param with the snapshot number\n\t\tTo see the changes, perform a dry run with the -dry param");
$this->out();
$this->out("\tschema help\n\t\tshows this help message.");
$this->out();
$this->out("\tschema view\n\t\tread and output contents of schema file");
$this->out();
$this->out("\tschema generate\n\t\treads from 'connection' writes to 'path'\n\t\tTo force generation of all tables into the schema, use the -f param.\n\t\tUse 'schema generate snapshot <number>' to generate snapshots\n\t\twhich you can use with the -s parameter in the other operations.");
$this->out();
$this->out("\tschema dump <filename>\n\t\tDump database sql based on schema file to <filename>. \n\t\tIf <filename> is write, schema dump will be written to a file\n\t\tthat has the same name as the app directory.");
$this->out();
$this->out("\tschema run create <schema> <table>\n\t\tDrop and create tables based on schema file\n\t\toptional <schema> arg for selecting schema name\n\t\toptional <table> arg for creating only one table\n\t\tpass the -s param with a number to use a snapshot\n\t\tTo see the changes, perform a dry run with the -dry param");
$this->out();
$this->out("\tschema run update <schema> <table>\n\t\talter tables based on schema file\n\t\toptional <schema> arg for selecting schema name.\n\t\toptional <table> arg for altering only one table.\n\t\tTo use a snapshot, pass the -s param with the snapshot number\n\t\tTo see the changes, perform a dry run with the -dry param");
$this->out();
$this->_stop();
}
Expand Down
1 change: 1 addition & 0 deletions cake/tests/cases/libs/model/cake_schema.test.php
Expand Up @@ -546,6 +546,7 @@ function testSchemaComparison() {
),
'drop' => array(
'article_id' => array('type' => 'integer', 'null' => false),
'tableParameters' => array()
),
'change' => array(
'comment' => array('type' => 'text', 'null' => false, 'default' => null)
Expand Down

0 comments on commit 76a88fc

Please sign in to comment.