프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$Version | MigrationVersion | MigrationVersion instance | |
$connection | null | string | Connection used for the migration_schema table of the migration versions | |
$migrationConnection | null | string | This can be used to override the connection of migration file | |
$path | string | Current path to load and save migrations | |
$skip | array | Skip a version or it can skip many version using comma as separate. | |
$type | string | Type of migration, can be 'app' or a plugin name |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_messages | array | Messages used to display action being performed |
메소드 | 설명 | |
---|---|---|
afterMigration ( &$Migration, string $direction ) : void | Callback used to create a new line after the migration | |
beforeAction ( &$Migration, string $type, array $data ) : void | Callback used to display actions being performed | |
beforeMigration ( &$Migration, string $direction ) : void | Callback used to display what migration is being runned | |
generate ( ) : void | Generate a new migration file | |
getOptionParser ( ) : string | Get the option parser. | |
main ( ) : void | Override main | |
run ( ) : void | Run the migrations | |
startup ( ) : void | Override startup | |
status ( ) : void | Displays a status of all plugin and app migrations |
메소드 | 설명 | |
---|---|---|
_connectionNamesEnum ( ) : array | Get a list of connection names. | |
_execute ( array $options, boolean $once ) : boolean | Execute migration | |
_fieldNamesArray ( array $fields ) : array | Return list of field names from array of field/index definitions | |
_finalizeGeneratedMigration ( &$migration, &$migrationName, &$fromSchema ) : void | Finalizes the generated migration - offers to preview it, prompts for a name, writes the file, and updates db version if needed. | |
_findSchemaFile ( Folder $folder, string $schemaFiles, string $name ) : mixed | Finds schema file | |
_fromComparison ( array $migration, array $comparison, array $oldTables, array $currentTables ) : array | Generate a migration string using comparison | |
_generateDump ( &$migration ) : void | Generate a dump of the current database. | |
_generateFromCliArgs ( &$migration, &$migrationName, &$comparison ) : void | Generate a migration from arguments passed in at the command line | |
_generateFromComparison ( &$migration, &$oldSchema, &$comparison ) : void | Generate a migration by comparing schema.php with the database. | |
_generateFromInverseComparison ( &$migration, &$oldSchema, &$comparison ) : void | Generate a migration by comparing the database with schema.php. | |
_generateMigration ( string $name, string $class, array $migration ) : string | Generate a migration | |
_generateTemplate ( string $template, array $vars ) : string | Include and generate a template string based on a template file | |
_getFieldType ( string $field, string $type, array $validTypes ) : string | Return valid field type based on name of field | |
_getPath ( string $type = null ) : string | Return the path used | |
_getSchema ( string $type = null ) : mixed | Load and construct the schema class if exists | |
_getSchemaClassName ( string $name = null, boolean $suffix = true ) : string | Gets the schema class name | |
_migrationChanges ( array $migration ) : boolean | _migrationsChanges method | |
_outputLog ( array $log ) : void | Output the SQL log in dry mode | |
_overwriteSchema ( ) : void | Overwrite the schema.php file | |
_parseCommandLineFields ( string $name ) : array | Parse fields from the command line for use with generating new migration files | |
_parseSingleCommandLineField ( &$fields, &$indexes, string $field, array $validTypes ) : void | Parse a single argument from the command line into the fields array | |
_promptForMigrationName ( ) : string | Prompt the user for a name for their new migration. | |
_promptVersionOptions ( array $mapping, string $latestVersion ) : array | Output prompt with different migration versions to choose from | |
_readSchema ( ) : array | Reads the schema data | |
_showInfo ( array $mapping, string $type = null ) : void | Shows a list of available migrations | |
_singleStepOptions ( array $mapping, string $latestVersion, array $default = [] ) : array | Single step options for up/down migrations | |
_startMigrationConnection ( ) : string | Set a migration connection | |
_updateSchema ( ) : void | Update the schema, making a call to schema shell | |
_values ( array $values ) : string | Format a array/string into a one-line syntax | |
_writeMigration ( string $name, integer $version, array $migration ) : boolean | Write a migration with given name |
protected _connectionNamesEnum ( ) : array | ||
리턴 | array | The list of connection names |
protected _fieldNamesArray ( array $fields ) : array | ||
$fields | array | Field/index definitions |
리턴 | array | List of field names |
protected _finalizeGeneratedMigration ( &$migration, &$migrationName, &$fromSchema ) : void | ||
리턴 | void |
protected _fromComparison ( array $migration, array $comparison, array $oldTables, array $currentTables ) : array | ||
$migration | array | Migration instructions array |
$comparison | array | Result from CakeSchema::compare() |
$oldTables | array | List of tables on schema.php file |
$currentTables | array | List of current tables on database |
리턴 | array |
protected _generateDump ( &$migration ) : void | ||
리턴 | void | (The variables passed by reference are changed; nothing is returned) |
protected _generateFromCliArgs ( &$migration, &$migrationName, &$comparison ) : void | ||
리턴 | void | (The variables passed by reference are changed; nothing is returned) |
protected _generateFromComparison ( &$migration, &$oldSchema, &$comparison ) : void | ||
리턴 | void | (The variables passed by reference are changed; nothing is returned) |
protected _generateFromInverseComparison ( &$migration, &$oldSchema, &$comparison ) : void | ||
리턴 | void | (The variables passed by reference are changed; nothing is returned) |
protected _getSchema ( string $type = null ) : mixed | ||
$type | string | Can be 'app' or a plugin name |
리턴 | mixed | False in case of no file found, schema object |
protected _migrationChanges ( array $migration ) : boolean | ||
$migration | array | list of migrations |
리턴 | boolean |
protected _outputLog ( array $log ) : void | ||
$log | array | List of queries per migration |
리턴 | void |
protected _overwriteSchema ( ) : void | ||
리턴 | void |
protected _parseCommandLineFields ( string $name ) : array | ||
$name | string | Name of migration |
리턴 | array |
protected _promptForMigrationName ( ) : string | ||
리턴 | string |
protected _startMigrationConnection ( ) : string | ||
리턴 | string | The name of the migration connection. |
protected _updateSchema ( ) : void | ||
리턴 | void |
public afterMigration ( &$Migration, string $direction ) : void | ||
$direction | string | Direction being runned |
리턴 | void |
public beforeMigration ( &$Migration, string $direction ) : void | ||
$direction | string | Direction being runned |
리턴 | void |
protected array $_messages | ||
리턴 | array |
public array $skip | ||
리턴 | array |