Abstract Migrator class. This class should be be instantiated directly.

Constructor

Defined migration.js Source
function (db,directory,opts){
   this.db = db;
   this.directory = directory;
   opts = opts || {};
   this.table = opts.table || this._static.DEFAULT_SCHEMA_TABLE;
   this.column = opts.column || this._static.DEFAULT_SCHEMA_COLUMN;
   this._opts = opts;
           
}
            

run Static Function Public


Defined migration.js

Migrates the database using migration files found in the supplied directory. See patio#migrate

Example
var DB = patio.connect("my://connection/string");
patio. migrate(DB, __dirname + "/timestamp_migration").chain(function(){
    console.log("done migrating!");
});

patio. migrate(DB, __dirname + "/timestamp_migration", {target : 0}).chain(function(){
    console.log("done migrating down!");
});
        
Arguments Returns Source
function (db,directory,opts,cb){
   if (isFunction(opts)) {
       cb = opts;
       opts = {};
   } else {
       opts = opts || {};
   }
   opts = opts || {};
   return this.__getMigrator(directory).chain(function (Migrator) {
       return new Migrator(db, directory, opts).run();
   }).classic(cb);
           
}
    

run Function Public


Defined migration.js

Runs the migration and returns a promise.

Source
function (){
   throw new NotImplemented("patio.migrations.Migrator#run");
           
}
    

Documentation generated using coddoc.