Property | Type | Description | |
---|---|---|---|
$Version | Model | Instance of SchemaMigrations model | |
$connection | string | Connection used for the migration_schema table of the migration versions | |
$dry | boolean | If try, the SQL will be outputted to screen rather than applied to the database | |
$jumpTo | null | string | Jump to a certain migration. | |
$log | array | This is used for dry run | |
$migrationConnection | null | string | This can be used to override the connection of migration file | |
$precheck | string | Precheck mode | |
$skip | array | Skip a version or it can skip many version using comma as separate. |
Property | Type | Description | |
---|---|---|---|
$_mapping | array | Mapping cache |
Method | Description | |
---|---|---|
__construct ( array $options = [] ) | Constructor | |
getMapping ( string $type, boolean $cache = true ) : mixed | Get mapping for the given type | |
getMigration ( string $name, string $class, string $type, array $options = [] ) : boolean | CakeMigration | Load and make a instance of the migration | |
getVersion ( string $type ) : integer | Get last version for given type | |
getVersionByName ( array $mapping ) : boolean | string | Will return a version based in the migration name | |
initVersion ( ) : void | Get a new SchemaMigration instance | |
jump ( array $version, array $type ) : void | Jump to a certain migration and mark the preceding migrations as executed. | |
run ( array $options ) : boolean | Run the migrations | |
setVersion ( integer $version, string $type, boolean $migrated = true ) : boolean | Set current version for given type |
Method | Description | |
---|---|---|
_enumerateMigrations ( string $type ) : array | Returns a map of all available migrations for a type (app or plugin) | |
_enumerateNewMigrations ( string $type ) : array | Returns a map of all available migrations for a type (app or plugin) using inflection | |
_enumerateOldMigrations ( string $type ) : array | Returns a map of all available migrations for a type (app or plugin) using regular expressions | |
_initMigrations ( ) : void | Initialize the migrations schema and keep it up-to-date | |
_loadFile ( string $name, string $type ) : mixed | Load a file based on name and type |
public __construct ( array $options = [] ) | ||
$options | array | optional load object properties |
protected _enumerateMigrations ( string $type ) : array | ||
$type | string | Can be 'app' or a plugin name |
return | array | containing a list of migration versions ordered by filename |
protected _enumerateNewMigrations ( string $type ) : array | ||
$type | string | Can be 'app' or a plugin name |
return | array | containing a list of migration versions ordered by filename |
protected _enumerateOldMigrations ( string $type ) : array | ||
$type | string | Can be 'app' or a plugin name |
return | array | containing a list of migration versions ordered by filename |
protected _initMigrations ( ) : void | ||
return | void |
public getMigration ( string $name, string $class, string $type, array $options = [] ) : boolean | CakeMigration | ||
$name | string | File name where migration resides |
$class | string | Migration class name |
$type | string | Can be 'app' or a plugin name |
$options | array | Extra options to send to CakeMigration class |
return | boolean | CakeMigration | False in case of no file found, instance of the migration |
public getVersion ( string $type ) : integer | ||
$type | string | Can be 'app' or a plugin name |
return | integer | Last version migrated |
public initVersion ( ) : void | ||
return | void |
public string $connection | ||
return | string |
public bool $dry | ||
return | boolean |
public array $skip | ||
return | array |