- Db\Migration
class Db \ Migration
- All known direct subclasses:
- AccountCurrencies,AccountHashCurrencies,AccountInstanceGenerator,AllMigrations,BlockCountMigrationGenerator,CopyOpenIDIdentities,CopyPasswords,CopyUsers,DifficultyMigrationGenerator,ExchangePairs,ExternalAPIsMigration,ExternalAPIsMigrationBlocks,GeneratedAccountInstanceMigration,GeneratedBlockCountMigration,GeneratedDifficultyMigration,GeneratedInstallBootstrapMigration,InstallBootstrapGenerator,RemoveEmailFromUserProperties,RemoveOpenIDIdentitiesTable,RemoveSecuritiesUpdateEligius,RemoveUserPropertiesFields,RenameBlockTables,RenameUsersTable,BaseMigration,UncaughtExceptionsMigration,JobExceptions,Jobs,JobsJobPrefix,CachedStringsMigration,PerformanceMetricsPagesMigration,PerformanceMetricsRepeatedUrls,PerformanceMetricsSlowUrls,PerformanceMetricsUrls,PerformanceReportSlowPagesMigration,PerformanceReportsMigration,User,UserNoEmailsRequired,UserOAuth2Identities,UserOpenIDIdentities,UserPassword,UserPasswordsReset,UserValidKeys
Represents a database "migration", which can be composed together with other migrations across multiple components to initialise a database and update it with updates.
Method Summary
Name | Description |
---|---|
apply(Connection $db) | Apply only the current migration. |
getAllParents() | Get all our parent Migrations along with all of its parents migrations into one unique array. |
getName() | |
getParents() | Get all parent Migrations that this migration depends on, as a list |
hasPending(Connection $db) | |
install(Connection $db, Logger $log) | Install the current migration and any parent migrations that this migration depends on. |
isApplied(Connection $db) | |
tableExists(Connection $db, $table) | Used e.g. in BaseMigration |
public function apply(Connection $db)
Apply only the current migration.
- Returns:
true on success or false on failure
public function getAllParents()
Get all our parent Migrations along with all of its parents migrations into one unique array.
public function getName()
public function getParents()
Get all parent Migrations that this migration depends on, as a list
public function hasPending(Connection $db)
- Returns:
true if this migration, or any of its parents, have pending migrations
public function install(Connection $db, Logger $log)
Install the current migration and any parent migrations that this migration depends on.
public function isApplied(Connection $db)
- Returns:
true if this migration is applied
public function tableExists(Connection $db, $table)
Used e.g. in BaseMigration
- Returns:
true if the given table exists