var _str = require('underscore.string'); var mkdirp = require('mkdirp');
The new migration we're performing.
Takes a config
object, which has the name
of the current migration (main
if not otherwise specified)
Initializes the migration, by creating the proper migration file or database table, depending on the migration config settings.
Create the migration table, if it doesn't already exist.
Runs a specific migration, based on the migration version number.
Migrate "up" to a specific migration id otherwise, migrates all migrations which have not been run yet.
Migrate "down" to a specific migration id, otherwise rolls back the last migration "batch".
Run a batch of current migrations, in sequence.
Retrieves and returns the current migration version
we're on, as a promise. If there aren't any migrations run yet,
return "none" as the value for the currentVersion
.
Creates a new migration, with a given name.
Lists all available migration versions, as an array.
Lists all migrations that have been completed for the current db, as an array.
Gets the migration list, and the list of completed migrations to check what should be run.
Shared between the up
and down
migrations, this
helps to create the batch of migrations that need to be run.
Gets the current migration.
Get all of the migrations that need to be run in the current batch.
Check if the current version of the query has run.
Parse the version, which really only needs to be the timestamp of the migration we wish to migrate to.
Get a date object in this form
Ensure that we have 2 places for each of the date segments
Migrate (WIP)