From 76a88fc4778c9d09e882266dccfa75b5b319ad2e Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 4 Oct 2009 10:04:48 -0400 Subject: [PATCH] Updating help() for Schema shell. --- cake/console/libs/schema.php | 50 ++++++++++++++----- .../cases/libs/model/cake_schema.test.php | 1 + 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/cake/console/libs/schema.php b/cake/console/libs/schema.php index 8fb8f21c021..3b4a3a26266 100644 --- a/cake/console/libs/schema.php +++ b/cake/console/libs/schema.php @@ -437,20 +437,44 @@ function help() { $this->out("Usage: cake schema ..."); $this->hr(); $this->out('Params:'); - $this->out("\n\t-connection \n\t\tset db config . uses 'default' if none is specified"); - $this->out("\n\t-path \n\t\tpath to read and write schema.php.\n\t\tdefault path: ". $this->Schema->path); - $this->out("\n\t-name \n\t\tclassname to use."); - $this->out("\n\t-file \n\t\tfile to read and write.\n\t\tdefault file: ". $this->Schema->file); - $this->out("\n\t-s \n\t\tsnapshot 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 "); + $this->out("\t\tset db config . uses 'default' if none is specified"); + $this->out(); + $this->out("\t-path "); + $this->out("\t\tpath to read and write schema.php."); + $this->out("\t\tdefault path: ". $this->Schema->path); + $this->out(); + $this->out("\t-name "); + $this->out("\t\tclassname to use."); + $this->out(); + $this->out("\t-file "); + $this->out("\t\tfile to read and write."); + $this->out("\t\tdefault file: ". $this->Schema->file); + $this->out(); + $this->out("\t-s "); + $this->out("\t\tsnapshot 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 ' to generate snapshots\n\t\twhich you can use with the -s parameter in the other operations."); - $this->out("\n\tschema dump \n\t\tDump database sql based on schema file to . \n\t\tIf 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 \n\t\tDrop and create tables based on schema file\n\t\toptional arg for selecting schema name\n\t\toptional
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
\n\t\talter tables based on schema file\n\t\toptional arg for selecting schema name.\n\t\toptional
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 ' to generate snapshots\n\t\twhich you can use with the -s parameter in the other operations."); + $this->out(); + $this->out("\tschema dump \n\t\tDump database sql based on schema file to . \n\t\tIf 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
\n\t\tDrop and create tables based on schema file\n\t\toptional arg for selecting schema name\n\t\toptional
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
\n\t\talter tables based on schema file\n\t\toptional arg for selecting schema name.\n\t\toptional
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(); } diff --git a/cake/tests/cases/libs/model/cake_schema.test.php b/cake/tests/cases/libs/model/cake_schema.test.php index d8788bb0028..a2ac69a5146 100644 --- a/cake/tests/cases/libs/model/cake_schema.test.php +++ b/cake/tests/cases/libs/model/cake_schema.test.php @@ -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)