diff --git a/lib/index.js b/lib/index.js index ba04729..54b1d3a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -57,7 +57,14 @@ module.exports = function(app, options) { app.model(MigrationMap); if (!options.enableRest) { - Migration.disableRemoteMethod('migrateTo', true); - Migration.disableRemoteMethod('rollbackTo', true); + if (Migration.disableRemoteMethodByName) { + // Loopback 3.x+ + Migration.disableRemoteMethodByName('migrateTo'); + Migration.disableRemoteMethodByName('rollbackTo'); + } else { + // Loopback 2.x + Migration.disableRemoteMethod('migrateTo', true); + Migration.disableRemoteMethod('rollbackTo', true); + } } }; diff --git a/lib/models/migration.json b/lib/models/migration.json index 8c0fba0..bcb9524 100644 --- a/lib/models/migration.json +++ b/lib/models/migration.json @@ -23,7 +23,6 @@ "methods": { "migrateTo": { "description": "Run all pending migrations", - "isStatic": true, "http": { "path": "/migrate", "verb": "get" @@ -36,7 +35,6 @@ }, "migrateByName": { "description": "Run specific migration by name", - "isStatic": true, "http": { "path": "/migrateByName", "verb": "get" @@ -55,7 +53,6 @@ }, "rollbackTo": { "description": "Rollback migrations", - "isStatic": true, "http": { "path": "/rollback", "verb": "get"