Apply models migrations for multitenant environments (excel DDL stage). See Version migrations tutorial
Methods
# createUbMigrateIfNotExists (dbConn: DBConnection, multitenancyEnabled: boolean) inner
Create ub_migration table if it does not exist
Arguments:
dbConn
: DBConnectionmultitenancyEnabled
: boolean
# getMigrationState (dbConn: DBConnection, modelsConfig: object) → Object inner
Read ub_version and ub_migration from database. Return 000000000
for model versions what not exists in ub_version
Arguments:
dbConn
: DBConnectionmodelsConfig
: object
# normalizeVersionInFileName (fn: string) → string inner
Normalize beginning of the string to match XXXYYYZZZ version pattern
- '2.13.21*' -> '002013021*'
- '02_1_1*' -> '002001001*'
- 'notA3digitsGroup' -> 'notA3digitsGroup'
Arguments:
fn
: string
# patchParamsForTenant (serverConfig, params) inner
Arguments:
serverConfig
:params
:
# readMigrations (models: Array.<object>) → Object inner
Load content of all _migrate
model sub-folders.
Files inside migrations already sorter in order for execution
# runFiles (filesToRun, params, root0) inner
Run filesToRun
Arguments:
filesToRun
:params
:root0
:conn
dbConnections
dbVersions
migrations