Constructor
new Migrator(options)
Create Migrator object.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object |
- Source:
Methods
(async) checkMigrations()
Get migration list
- Source:
(async) ensure() → {Promise}
Ensure we have migration entry in DB.
- Source:
Returns:
- Type
- Promise
(private) fromOptions()
Recheck options
- Source:
getLastMigrationID() → {Number}
Get max migration ID from the map
- Source:
Returns:
- Type
- Number
(async) getMigrationsToRun() → {Promise.<Set>}
Get list of migrations to run
- Source:
Returns:
- Type
- Promise.<Set>
(async) getState() → {Promise.<MigrationState>}
Get state
- Source:
Returns:
- Type
- Promise.<MigrationState>
(async) migrate() → {Promise}
Do the actual migrations
- Source:
Returns:
- Type
- Promise
(async) saveState(state)
Save state
Parameters:
Name | Type | Description |
---|---|---|
state |
MigrationState |
- Source:
(async) verifyDB() → {Promise}
Do any necessary database checks
- Source:
Returns:
- Type
- Promise
writeState(b, state)
Write state
Parameters:
Name | Type | Description |
---|---|---|
b |
Batch | |
state |
MigrationState |
- Source: