Class SchemaShell
Schema is a command-line database management utility for automating programmer chores.
Schema is CakePHP's database management utility. This helps you maintain versions of of your database.
- AppShell
- SchemaShell
Link: http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html
Copyright: Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
License: MIT License
Location: Cake/Console/Command/SchemaShell.php
Properties summary
Method Summary
-
_create() protected
Create database from Schema object Should be called via the run method
-
_loadSchema() protected
Prepares the Schema objects for database operations. -
_run() protected
Runs sql from _create() or _update() -
_update() protected
Update database with Schema object Should be called via the run method
-
create() public
Run database create commands. Alias for run create. -
dump() public
Dump Schema object to sql file Use the
write
param to enable and control SQL file output location. Simply using -write will write the sql file to the same dir as the schema file. If -write contains a full path name the file will be saved there. If -write only contains no DS, that will be used as the file name, in the same dir as the schema file. -
generate() public
Read database and Write schema object accepts a connection as first arg or path to save as second arg
-
getOptionParser() public
get the option parser -
startup() public
Override startup -
update() public
Run database create commands. Alias for run create. -
view() public
Read and output contents of schema object path to read as second arg
Method Detail
_create() protected ¶
_create( CakeSchema
$Schema , string $table = null )
Create database from Schema object Should be called via the run method
Parameters
-
CakeSchema
$Schema - string $table optional null
_update() protected ¶
_update( CakeSchema
$Schema , string $table = null )
Update database with Schema object Should be called via the run method
Parameters
-
CakeSchema
$Schema - string $table optional null
dump() public ¶
dump( )
Dump Schema object to sql file
Use the write
param to enable and control SQL file output location.
Simply using -write will write the sql file to the same dir as the schema file.
If -write contains a full path name the file will be saved there. If -write only
contains no DS, that will be used as the file name, in the same dir as the schema file.
Returns
generate() public ¶
generate( )
Read database and Write schema object accepts a connection as first arg or path to save as second arg