Apply models migrations for multitenant environments (excel DDL stage). See Version migrations tutorial

Methods

# createUbMigrateIfNotExists (dbConnDBConnection, multitenancyEnabledboolean) inner

Create ub_migration table if it does not exist

Arguments:

# getMigrationState (dbConnDBConnection, modelsConfigobject) → Object inner

Read ub_version and ub_migration from database. Return 000000000 for model versions what not exists in ub_version

Arguments:

# normalizeVersionInFileName (fnstring) → string inner

Normalize beginning of the string to match XXXYYYZZZ version pattern

  • '2.13.21*' -> '002013021*'
  • '02_1_1*' -> '002001001*'
  • 'notA3digitsGroup' -> 'notA3digitsGroup'

Arguments:

# patchParamsForTenant (serverConfig, params) inner

Arguments:
  • serverConfig:
  • params:

# readMigrations (modelsArray.<object>) → Object inner

Load content of all _migrate model sub-folders. Files inside migrations already sorter in order for execution

Arguments:

# runFiles (filesToRun, params, root0) inner

Run filesToRun

Arguments:
  • filesToRun:
  • params:
  • root0:
    • conn

    • dbConnections

    • dbVersions

    • migrations