var db      = stex.db;

var migrate = module.exports;

migrate.run = function (cmd, arg) {
  switch (cmd) {
  case 'make':
    return db.migrate.make(arg);
  case 'latest':
    return db.migrate.latest();
  case 'rollback':
    return db.migrate.rollback();
  case 'currentVersion':
    return db.migrate.currentVersion()
      .then(function (result) {
        console.log(result);
      })
  default:
    throw new Error("Unknown cmd " + cmd);
  }
}

@@ -48,16 +48,173 @@
 ports;%0A%0A
+// TODO: remove directory config below once backwards compatibility with db-migrate is removed%0Avar config = %7B%0A  directory: stex.root + %22/migrations-knex%22%0A%7D%0A%0A
 migrate.
@@ -303,16 +303,24 @@
 make(arg
+, config
 );%0A  cas
@@ -360,16 +360,22 @@
 .latest(
+config
 );%0A  cas
@@ -419,16 +419,22 @@
 ollback(
+config
 );%0A  cas
@@ -490,16 +490,22 @@
 Version(
+config
 )%0A      

Use migration-knex to maintain backwards compat with db-migrate