|
Doctrine 1.2.4
|
Public Member Functions | |
| __construct ($directory=null, $connection=null) | |
| addError (Exception $e) | |
| clearErrors () | |
| getCurrentVersion () | |
| getErrors () | |
| getLatestVersion () | |
| getMigrationClass ($num) | |
| getMigrationClasses () | |
| getMigrationClassesDirectory () | |
| getNextMigrationClassVersion () | |
| getNextVersion () | |
| getNumErrors () | |
| getTableName () | |
| hasErrors () | |
| hasMigrated () | |
| loadMigrationClass ($name, $path=null) | |
| loadMigrationClassesFromDirectory ($directory=null) | |
| migrate ($to=null, $dryRun=false) | |
| migrateDryRun ($to=null) | |
| setCurrentVersion ($number) | |
| setTableName ($tableName) | |
Protected Member Functions | |
| _createMigrationTable () | |
| _doMigrate ($to) | |
| _doMigrateStep ($direction, $num) | |
| _throwErrorsException () | |
Definition at line 35 of file Migration.php.
| Doctrine_Migration::__construct | ( | $directory = null, |
|
$connection = null |
|||
| ) |
Specify the path to the directory with the migration classes. The classes will be loaded and the migration table will be created if it does not already exist
| string | $directory | The path to your migrations directory |
| mixed | $connection | The connection name or instance to use for this migration |
Definition at line 57 of file Migration.php.
|
protected |
Create the migration table and return true. If it already exists it will silence the exception and return false
Definition at line 546 of file Migration.php.
|
protected |
Do the actual migration process
| integer | $to |
| Doctrine_Exception |
Definition at line 467 of file Migration.php.
|
protected |
Perform a single migration step. Executes a single migration class and processes the changes
| string | $direction | Direction to go, 'up' or 'down' |
| integer | $num |
Definition at line 498 of file Migration.php.
|
protected |
Throw an exception with all the errors trigged during the migration
| Doctrine_Migration_Exception::$e |
Definition at line 443 of file Migration.php.
| Doctrine_Migration::addError | ( | Exception | $e | ) |
Add an error to the stack. Excepts some type of Exception
| Exception | $e |
Definition at line 406 of file Migration.php.
| Doctrine_Migration::clearErrors | ( | ) |
Clears the error exceptions
Definition at line 395 of file Migration.php.
| Doctrine_Migration::getCurrentVersion | ( | ) |
Get the current version of the database
Definition at line 240 of file Migration.php.
| Doctrine_Migration::getErrors | ( | ) |
Get all the error exceptions
Definition at line 385 of file Migration.php.
| Doctrine_Migration::getLatestVersion | ( | ) |
Gets the latest possible version from the loaded migration classes
Definition at line 268 of file Migration.php.
| Doctrine_Migration::getMigrationClass | ( | $num | ) |
Get instance of migration class for number/version specified
| integer | $num |
| Doctrine_Migration_Exception::$e |
Definition at line 427 of file Migration.php.
| Doctrine_Migration::getMigrationClasses | ( | ) |
Get all the loaded migration classes. Array where key is the number/version and the value is the class name.
Definition at line 215 of file Migration.php.
| Doctrine_Migration::getMigrationClassesDirectory | ( | ) |
Get the migration classes directory
Definition at line 96 of file Migration.php.
| Doctrine_Migration::getNextMigrationClassVersion | ( | ) |
Get the next incremented class version based on the loaded migration classes
Definition at line 292 of file Migration.php.
| Doctrine_Migration::getNextVersion | ( | ) |
Get the next incremented version number based on the latest version number using getLatestVersion()
Definition at line 282 of file Migration.php.
| Doctrine_Migration::getNumErrors | ( | ) |
Get the number of errors
Definition at line 375 of file Migration.php.
| Doctrine_Migration::getTableName | ( | ) |
Get the table name for storing the version number for this migration instance
Definition at line 106 of file Migration.php.
| Doctrine_Migration::hasErrors | ( | ) |
Whether or not the migration instance has errors
Definition at line 416 of file Migration.php.
| Doctrine_Migration::hasMigrated | ( | ) |
hReturns true/false for whether or not this database has been migrated in the past
Definition at line 254 of file Migration.php.
| Doctrine_Migration::loadMigrationClass | ( | $name, | |
$path = null |
|||
| ) |
Load the specified migration class name in to this migration instances queue of migration classes to execute. It must be a child of Doctrine_Migration in order to be loaded.
| string | $name |
Definition at line 177 of file Migration.php.
| Doctrine_Migration::loadMigrationClassesFromDirectory | ( | $directory = null | ) |
Load migration classes from the passed directory. Any file found with a .php extension will be passed to the loadMigrationClass()
| string | $directory | Directory to load migration classes from |
Definition at line 130 of file Migration.php.
| Doctrine_Migration::migrate | ( | $to = null, |
|
$dryRun = false |
|||
| ) |
Perform a migration process by specifying the migration number/version to migrate to. It will automatically know whether you are migrating up or down based on the current version of the database.
| integer | $to | Version to migrate to |
| boolean | $dryRun | Whether or not to run the migrate process as a dry run |
| Doctrine_Exception |
Definition at line 313 of file Migration.php.
| Doctrine_Migration::migrateDryRun | ( | $to = null | ) |
Run the migration process but rollback at the very end. Returns true or false for whether or not the migration can be ran
| string | $to |
Definition at line 365 of file Migration.php.
| Doctrine_Migration::setCurrentVersion | ( | $number | ) |
Set the current version of the database
| integer | $number |
Definition at line 226 of file Migration.php.
| Doctrine_Migration::setTableName | ( | $tableName | ) |
Set the table name for storing the version number for this migration instance
| string | $tableName |
Definition at line 117 of file Migration.php.