MigrationService

class OC\DB\MigrationService
Source:lib/private/DB/MigrationService.php#48

Properties

Methods

public OC\DB\MigrationService::__construct($appName, $connection, $output=null, $appLocator=null)
MigrationService constructor.
Source:

lib/private/DB/MigrationService.php#72

Parameters:
Throws:

\Exception

public OC\DB\MigrationService::getApp()
Returns the name of the app for which this migration is executed
Source:lib/private/DB/MigrationService.php#115
Returns:string
public OC\DB\MigrationService::getMigratedVersions()
Returns all versions which have already been applied
Source:lib/private/DB/MigrationService.php#191
Returns:string[]
public OC\DB\MigrationService::getAvailableVersions()
Returns all versions which are available in the migration folder
Source:lib/private/DB/MigrationService.php#212
Returns:array
protected OC\DB\MigrationService::findMigrations()
Source:lib/private/DB/MigrationService.php#217
public OC\DB\MigrationService::getMigrationsTableName()
Returns the name of the table which holds the already applied versions
Source:lib/private/DB/MigrationService.php#309
Returns:string
public OC\DB\MigrationService::getMigrationsNamespace()
Returns the namespace of the version classes
Source:lib/private/DB/MigrationService.php#318
Returns:string
public OC\DB\MigrationService::getMigrationsDirectory()
Returns the directory which holds the versions
Source:lib/private/DB/MigrationService.php#327
Returns:string
public OC\DB\MigrationService::getMigration($alias)
Return the explicit version for the aliases; current, next, prev, latest
Source:

lib/private/DB/MigrationService.php#337

Parameters:
  • $alias (string)
Returns:

mixed | null | string

public OC\DB\MigrationService::setOutput($output)
Allows to set an IOutput implementation which is used for logging progress and messages
Source:

lib/private/DB/MigrationService.php#405

Parameters:
public OC\DB\MigrationService::migrate($to=latest, $schemaOnly=false)
Applies all not yet applied versions up to $to
Source:

lib/private/DB/MigrationService.php#416

Parameters:
  • $to (string)
  • $schemaOnly (bool)
Throws:

\InvalidArgumentException

public OC\DB\MigrationService::migrateSchemaOnly($to=latest)
Applies all not yet applied versions up to $to
Source:

lib/private/DB/MigrationService.php#441

Parameters:
  • $to (string)
Throws:

\InvalidArgumentException

public OC\DB\MigrationService::describeMigrationStep($to=latest)
Get the human readable descriptions for the migration steps to run
Source:

lib/private/DB/MigrationService.php#479

Parameters:
  • $to (string)
Returns:

string[] [$name => $description]

protected OC\DB\MigrationService::createInstance($version)
Source:

lib/private/DB/MigrationService.php#496

Parameters:
  • $version (string)
Returns:

\OCP\Migration\IMigrationStep

Throws:

\InvalidArgumentException

public OC\DB\MigrationService::executeStep($version, $schemaOnly=false)
Executes one explicit version
Source:

lib/private/DB/MigrationService.php#522

Parameters:
  • $version (string)
  • $schemaOnly (bool)
Throws:

\InvalidArgumentException

public OC\DB\MigrationService::ensureOracleConstraints($sourceSchema, $targetSchema, $prefixLength)
Naming constraints:
- Tables names must be 30 chars or shorter (27 + oc_ prefix)
- Column names must be 30 chars or shorter
- Index names must be 30 chars or shorter
- Sequence names must be 30 chars or shorter
- Primary key names must be set or the table name 23 chars or shorter
Data constraints:
- Columns with “NotNull” can not have empty string as default value
- Columns with “NotNull” can not have number 0 as default value
- Columns with type “bool” (which is in fact integer of length 1) can not be “NotNull” as it can not store 0/false
Source:

lib/private/DB/MigrationService.php#572

Parameters:
  • $sourceSchema (Doctrine\DBAL\Schema\Schema)
  • $targetSchema (Doctrine\DBAL\Schema\Schema)
  • $prefixLength (int)
Throws:

\Doctrine\DBAL\Exception