You are currently viewing the 1.0 version of the API documentation. Switch to 2.0 or 1.1 or 1.2.

Doctrine Migration

this class represents a database view

Method Summary

Returns Name Description
addChange
addColumn
addIndex
changeColumn renameColumn
createConstraint
createForeignKey
createMigrationTable Creates the migration table used to store the current version
createTable
doMigrate Perform migration for a migration class. Executes the up or down method then processes the changes
doMigrateStep Perform migration directory for the specified version. Loads migration classes and performs the migration then processes the changes
dropConstraint
dropForeignKey
dropTable
getCurrentVersion Get the current version of the database
getLatestVersion Gets the latest possible version from the loaded migration classes
getMigrationClass Get instance of migration class for $num
getMigrationClasses
integer getNextVersion
getTableName
hasMigrated Returns true/false for whether or not this database has been migrated in the past
loadMigrationClasses Loads the migration classes for the directory specified by the constructor
loadMigrationClassesFromDirectory refactored out from loadMigrationClasses $param array An array of classes
migrate Perform a migration chain by specifying the $from and $to. If you do not specify a $from or $to then it will attempt to migrate from the current version to the latest version
postDown
postUp
preDown
preUp
removeColumn
removeIndex
renameColumn
renameTable
setCurrentVersion Sets the current version in the migration table
setTableName
__construct construct 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

Method Details

  • addChange($type, $change = array(), $array)


  • addColumn($tableName, $columnName, $type, $options = array(), $array)


  • addIndex($tableName, $indexName, $definition, $array)


  • changeColumn($tableName, $columnName, $type, $options = array(), $array)

    renameColumn


  • createConstraint($tableName, $constraintName, $definition)


  • createForeignKey($tableName, $definition, $constraintName)


  • createMigrationTable()

    Creates the migration table used to store the current version


  • createTable($tableName, $fields = array(), $options = array(), $array)


  • doMigrate($direction)

    Perform migration for a migration class. Executes the up or down method then processes the changes


  • doMigrateStep($direction, $num)

    Perform migration directory for the specified version. Loads migration classes and performs the migration then processes the changes


  • dropConstraint($tableName, $constraintName, $primary = false)


  • dropForeignKey($tableName, $fkName, $constraintName)


  • dropTable($tableName)


  • getCurrentVersion()

    Get the current version of the database


  • getLatestVersion()

    Gets the latest possible version from the loaded migration classes


  • getMigrationClass($num)

    Get instance of migration class for $num


  • getMigrationClasses()


  • (integer) getNextVersion()


  • getTableName()


  • hasMigrated()

    Returns true/false for whether or not this database has been migrated in the past


  • loadMigrationClasses()

    Loads the migration classes for the directory specified by the constructor


  • loadMigrationClassesFromDirectory()

    refactored out from loadMigrationClasses $param array An array of classes


  • migrate($to = null, $from)

    Perform a migration chain by specifying the $from and $to. If you do not specify a $from or $to then it will attempt to migrate from the current version to the latest version


  • postDown()


  • postUp()


  • preDown()


  • preUp()


  • removeColumn($tableName, $columnName)


  • removeIndex($tableName, $indexName)


  • renameColumn($tableName, $oldColumnName, $newColumnName)


  • renameTable($oldTableName, $newTableName)


  • setCurrentVersion($number)

    Sets the current version in the migration table


  • setTableName($tableName)


  • __construct($directory = null)

    construct

    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