| DataMigrationManager | R Documentation |
R6 class for management of database migration
data frame all migrations, including file name, order and execution status Get connection handler
migrationPathPath migrations exist in
databaseSchemaPath migrations exist in
packageNamepackageName, can be null
tablePrefixtablePrefix, can be empty character vector
packageTablePrefixpackageTablePrefix, can be empty character vector
new()DataMigrationManager$new( connectionDetails, databaseSchema, tablePrefix = "", packageTablePrefix = "", migrationPath, packageName = NULL, migrationRegexp = .defaultMigrationRegexp )
connectionDetailsDatabaseConnector connection details object
databaseSchemaDatabase Schema to execute on
tablePrefixOptional table prefix for all tables (e.g. plp, cm, cd etc)
packageTablePrefixA table prefix when used in conjunction with other package results schema, e.g. "cd_", "sccs_", "plp_", "cm_"
migrationPathPath to location of migration sql files. If in package mode, this should just be a folder (e.g. "migrations") that lives in the location "sql/sql_server" (and) other database platforms. If in folder model, the folder must include "sql_server" in the relative path, (e.g if migrationPath = 'migrations' then the folder 'migrations/sql_server' should exists)
packageNameIf in package mode, the name of the R package
migrationRegexp(Optional) regular expression pattern default is (Migration_([0-9]+))-(.+).sql
Migration table exists
migrationTableExists()Check if migration table is present in schema
DataMigrationManager$migrationTableExists()
boolean Get path of migrations
getMigrationsPath()Get path to sql migration files
DataMigrationManager$getMigrationsPath(dbms = "sql server")
dbmsOptionally specify the dbms that the migration fits under Get status of result model
getStatus()Get status of all migrations (executed or not)
DataMigrationManager$getStatus()
getConnectionHandler()Return connection handler instance
DataMigrationManager$getConnectionHandler()
ConnectionHandler instance Check migrations in folder
check()Check if file names are valid for migrations Execute Migrations
DataMigrationManager$check()
executeMigrations()Execute any unexecuted migrations
DataMigrationManager$executeMigrations(stopMigrationVersion = NULL)
stopMigrationVersion(Optional) Migrate to a specific migration number isPackage
isPackage()is a package folder structure or not finalize
DataMigrationManager$isPackage()
finalize()close database connection
DataMigrationManager$finalize()
clone()The objects of this class are cloneable with this method.
DataMigrationManager$clone(deep = FALSE)
deepWhether to make a deep clone.
ConnectionHandler for information on returned class
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.