File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,14 @@ module.exports = function(app, options) {
57
57
app . model ( MigrationMap ) ;
58
58
59
59
if ( ! options . enableRest ) {
60
- Migration . disableRemoteMethod ( 'migrateTo' , true ) ;
61
- Migration . disableRemoteMethod ( 'rollbackTo' , true ) ;
60
+ if ( Migration . disableRemoteMethodByName ) {
61
+ // Loopback 3.x+
62
+ Migration . disableRemoteMethodByName ( 'migrateTo' ) ;
63
+ Migration . disableRemoteMethodByName ( 'rollbackTo' ) ;
64
+ } else {
65
+ // Loopback 2.x
66
+ Migration . disableRemoteMethod ( 'migrateTo' , true ) ;
67
+ Migration . disableRemoteMethod ( 'rollbackTo' , true ) ;
68
+ }
62
69
}
63
70
} ;
Original file line number Diff line number Diff line change 23
23
"methods" : {
24
24
"migrateTo" : {
25
25
"description" : " Run all pending migrations" ,
26
- "isStatic" : true ,
27
26
"http" : {
28
27
"path" : " /migrate" ,
29
28
"verb" : " get"
36
35
},
37
36
"migrateByName" : {
38
37
"description" : " Run specific migration by name" ,
39
- "isStatic" : true ,
40
38
"http" : {
41
39
"path" : " /migrateByName" ,
42
40
"verb" : " get"
55
53
},
56
54
"rollbackTo" : {
57
55
"description" : " Rollback migrations" ,
58
- "isStatic" : true ,
59
56
"http" : {
60
57
"path" : " /rollback" ,
61
58
"verb" : " get"
You can’t perform that action at this time.
0 commit comments