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 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() protectedCreate database from Schema object Should be called via the run method 
- 
			_loadSchema() protectedPrepares the Schema objects for database operations.
- 
			_run() protectedRuns sql from _create() or _update()
- 
			_update() protectedUpdate database with Schema object Should be called via the run method 
- 
			create() publicRun database create commands. Alias for run create.
- 
			dump() publicDump Schema object to sql file Use the writeparam 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() publicRead database and Write schema object accepts a connection as first arg or path to save as second arg 
- 
			getOptionParser() publicGets the option parser instance and configures it.
- 
			startup() publicOverride startup
- 
			update() publicRun database create commands. Alias for run create.
- 
			view() publicRead 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
- The schema instance to create.
- string $table optional null
- The table name.
_run() protected ¶
_run( array $contents , string $event , CakeSchema $Schema )
		
Runs sql from _create() or _update()
Parameters
- array $contents
- The contents to execute.
- string $event
- The event to fire
- 
						CakeSchema$Schema
- The schema instance.
_update() protected ¶
_update( CakeSchema $Schema , string $table = null )
		
Update database with Schema object Should be called via the run method
Parameters
- 
						CakeSchema$Schema
- $Schema The schema instance
- string $table optional null
- The table name.
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
