OpenVeo Core server

API Docs for: 7.0.0
Show:

migrationProcess

Summary

Provides functions to execute migration script.

Methods

createMigrationSeries

Syntax

createMigrationSeries

(
  • module
  • name
)
Array private static

Summary

Creates async series according to migration script order.

Parameters:

  • module Object

    Script collection to execute exemple: { 1.1.0 : 'path/to/migration/1.1.0.js', 1.2.0 : 'path/to/migration/1.2.0.js' }

  • name String

    Name of module (core, publish...)

Returns:

Array:

Array of synchronous function to execute

executeMigrationScript

Syntax

executeMigrationScript

(
  • migrations
  • callback
)

Summary

Executes a collection of migration script.

Parameters:

  • migrations Object

    migrations object to execute exemple: { core:{ 1.1.0: 'path/to/migration/1.1.0.js', 2.0.0: 'path/to/migration/2.0.0.js' }, publish:{ 1.2.0: 'path/to/migration/1.2.0.js', 1.3.0: 'path/to/migration/1.3.0.js', } }

  • callback Function

    A callback with 1 arguments :

    • Error An Error object or null

saveMigrationVersion

Syntax

saveMigrationVersion

(
  • name
  • version
  • db
  • callback
)
private static

Summary

Saves in core_system table the last migration successfull done.

Parameters:

  • name String

    Name of module (core, publish...)

  • version String

    Version of the script successfully executed

  • db Object

    DB instance to update value

  • callback Function

    callback A callback with 1 arguments :

    • Error An Error object or null