R6 class for management of database migration
Value
data frame all migrations, including file name, order and execution status Get connection handler
See also
ConnectionHandler for information on returned class
Public fields
migrationPathPath migrations exist in
databaseSchemaPath migrations exist in
packageNamepackageName, can be null
tablePrefixtablePrefix, can be empty character vector
packageTablePrefixpackageTablePrefix, can be empty character vector
Methods
Method new()
Usage
DataMigrationManager$new(
connectionDetails,
databaseSchema,
tablePrefix = "",
packageTablePrefix = "",
migrationPath,
packageName = NULL,
migrationRegexp = .defaultMigrationRegexp
)Arguments
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]+))-(.+).sqlMigration table exists