PHP Class MigrateShell, cakephp-db-migrations

Inheritance: extends Shell
Datei anzeigen Open project: joelmoss/cakephp-db-migrations

Public Properties

Property Type Description
$_is_plugin True is shell is used as part of a plugin
$_usePrefix Should we use a table prefix, as specified in DB config
$background
$current_migration Current migration data
$dataSource The datasource that should be used.
$db The database object
$empty_migration Empty migration data
$foreground
$id_format
$migrations Array of migrations
$options
$schema_table Name of the schema migrations table
$styles
$target_migration Target migration data
$types DB column/field types
$unmigrated_migrations Un-migrated migrations
$use_uuid If true, will use Cake's UUID's for primary key.
$uuid_format

Public Methods

Method Description
__buildUpSchema ( $tableName )
_array2Sql ( $array )
_buildSchema ( array $tables = null, $allTables = false ) : unknown Burns the provided tables Schema into a YAML file suitable for migrations
_buildYaml ( $tables )
_colorize ( $text = '', $style = null )
_filterMigrationTable ( $myTables )
_fromDb ( )
_getMigrations ( )
_getName ( ) : the Forces the user to specify the model he wants to bake, and returns the selected model name.
_getProperties ( $props )
_getTables ( ) Gets the tables in DB according to your connection configuration
_hasMigrations ( )
_initDatabase ( )
_listAll ( ) : output Outputs the a list of possible models or controllers from database
_loadVendor ( $class )
_mate ( string $file ) Gives the user an option to open a specified file in Textmate
_parsePhp ( $file )
_printQuery ( )
_run ( $target_direction = null )
_sortMigrations ( $dir = 'up' )
_startMigration ( $id, $direction )
_supportsColors ( )
_versionIt ( $num ) Converts migration number to a minimum three digit number.
_welcome ( )
all ( ) Runs all migrations from the current version down and back up to the latest version.
down ( ) Migrates down to the previous version
err ( $str )
full_schema ( ) Migrates the full_schema.yml migration file.
g ( )
gen ( ) Aliases for generate method
generate ( ) Generates a migration file. You can pass the file name on the command line, or wait for the prompt.
h ( ) Aliases for help method
help ( ) Help method
info ( ) Prints list of migration files and provides info about each one
main ( ) Main method: migrates to the latest version.
out ( string $string = '', boolean $newline = true ) Modifies the out method for prettier formatting
reset ( ) Reset's migration version without running migrations up or down and drops all tables
startup ( )
up ( ) Migrates up to the next version

Method Details

__buildUpSchema() public method

public __buildUpSchema ( $tableName )

_array2Sql() public method

public _array2Sql ( $array )

_buildSchema() public method

Burns the provided tables Schema into a YAML file suitable for migrations
public _buildSchema ( array $tables = null, $allTables = false ) : unknown
$tables array
return unknown

_buildYaml() public method

public _buildYaml ( $tables )

_colorize() public method

public _colorize ( $text = '', $style = null )

_filterMigrationTable() public method

public _filterMigrationTable ( $myTables )

_fromDb() public method

public _fromDb ( )

_getMigrations() public method

public _getMigrations ( )

_getName() public method

Forces the user to specify the model he wants to bake, and returns the selected model name.
public _getName ( ) : the
return the model name

_getProperties() public method

public _getProperties ( $props )

_getTables() public method

Gets the tables in DB according to your connection configuration
public _getTables ( )

_hasMigrations() public method

public _hasMigrations ( )

_initDatabase() public method

public _initDatabase ( )

_listAll() public method

Outputs the a list of possible models or controllers from database
public _listAll ( ) : output
return output

_loadVendor() public method

public _loadVendor ( $class )

_mate() public method

Gives the user an option to open a specified file in Textmate
public _mate ( string $file )
$file string a file that will be opened with Textmate

_parsePhp() public method

public _parsePhp ( $file )

_printQuery() public method

public _printQuery ( )

_run() public method

public _run ( $target_direction = null )

_sortMigrations() public method

public _sortMigrations ( $dir = 'up' )

_startMigration() public method

public _startMigration ( $id, $direction )

_supportsColors() public method

public _supportsColors ( )

_versionIt() public method

Converts migration number to a minimum three digit number.
public _versionIt ( $num )
$num The number to convert

_welcome() public method

public _welcome ( )

all() public method

Runs all migrations from the current version down and back up to the latest version.
public all ( )

down() public method

Migrates down to the previous version
public down ( )

err() public method

public err ( $str )

full_schema() public method

Migrates the full_schema.yml migration file.
public full_schema ( )

g() public method

public g ( )

gen() public method

Aliases for generate method
public gen ( )

generate() public method

Example: 'cake migrate generate my migration file name'
public generate ( )

h() public method

Aliases for help method
public h ( )

help() public method

Help method
public help ( )

info() public method

Prints list of migration files and provides info about each one
public info ( )

main() public method

Main method: migrates to the latest version.
public main ( )

out() public method

Modifies the out method for prettier formatting
public out ( string $string = '', boolean $newline = true )
$string string String to output.
$newline boolean If true, the outputs gets an added newline.

reset() public method

Reset's migration version without running migrations up or down and drops all tables
public reset ( )

startup() public method

public startup ( )

up() public method

Migrates up to the next version
public up ( )

Property Details

$_is_plugin public_oe property

True is shell is used as part of a plugin
public $_is_plugin

$_usePrefix public_oe property

Should we use a table prefix, as specified in DB config
public $_usePrefix

$background public_oe property

public $background

$current_migration public_oe property

Current migration data
public $current_migration

$dataSource public_oe property

The datasource that should be used.
public $dataSource

$db public_oe property

The database object
public $db

$empty_migration public_oe property

Empty migration data
public $empty_migration

$foreground public_oe property

public $foreground

$id_format public_oe property

public $id_format

$migrations public_oe property

Array of migrations
public $migrations

$options public_oe property

public $options

$schema_table public_oe property

Name of the schema migrations table
public $schema_table

$styles public_oe property

public $styles

$target_migration public_oe property

Target migration data
public $target_migration

$types public_oe property

DB column/field types
public $types

$unmigrated_migrations public_oe property

Un-migrated migrations
public $unmigrated_migrations

$use_uuid public_oe property

If true, will use Cake's UUID's for primary key.
public $use_uuid

$uuid_format public_oe property

public $uuid_format