code: 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);
          }
docs: Migrates the database using migration files found in the supplied directory.
  See {@link 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!");
  });
  
  
  @param {patio.Database} db the database to migrate
  @param {String} directory directory that the migration files reside in
  @param {Object} [opts={}] optional parameters.
  @param {String} [opts.column] the column in the table that version information should be stored.
  @param {String} [opts.table] the table that version information should be stored.
  @param {Number} [opts.target] the target migration(i.e the migration to migrate up/down to).
  @param {String} [opts.current] the version that the database is currently at if the current version
  is not provided it is retrieved from the database.
  
  @return {Promise} a promise that is resolved once the migration is complete.