Skip to main content

Function: versionDataStore()

versionDataStore(directory): (id) => Promise<void>

Defined in: data-stores.ts:68

Version an data store (e.g. database, cache, etc.) by its id.

Takes the latest data store and moves it to a versioned directory. All files with this data store are also versioned (e.g /containers/orders-db/schema.json)

Parameters

ParameterType
directorystring

Returns

Function

Parameters

ParameterType
idstring

Returns

Promise<void>

Examples

import utils from '@eventcatalog/utils';

const { versionDataStore } = utils('/path/to/eventcatalog');

// moves the latest orders-db data store to a versioned directory
// the version within that data store is used as the version number.
await versionDataStore('orders-db');

import utils from '@eventcatalog/utils';

const { versionContainer } = utils('/path/to/eventcatalog');

// moves the latest orders-db container to a versioned directory
// the version within that container is used as the version number.
await versionContainer('orders-db');