Class: MigrationState

MigrationState()

State of database migrations. Because migration IDs are only increasing, we only need to store the last one.

Constructor

new MigrationState()

Create MigrationState

Properties:
Name Type Description
inProgress Boolean

is/was migration in progress NOTE: If inProgress is true, we know lastMigration + 1 was the one in progress.

lastMigration Number

last migration NOTE: Migration numbers start from 1. 0 - means there is no migration.

Source:

Methods

getSize() → {Number}

Get size of the encoded migration state object.

Source:
Returns:
Type
Number

inject(obj)

Inject properties from another state.

Parameters:
Name Type Description
obj MigrationState
Source:
Returns:

MigrationState;

read(br) → {MigrationState}

Deserialize migration state.

Parameters:
Name Type Description
br BufferReader
Source:
Returns:
Type
MigrationState

write(bw) → {BufferWriter}

Serialize migration state.

Parameters:
Name Type Description
bw BufferWriter
Source:
Returns:
Type
BufferWriter