@@ -87,7 +87,7 @@ function registerEvents() {
87
87
process . exit ( 1 ) ;
88
88
} ) ;
89
89
90
- process . on ( 'unhandledRejection' , function ( reason , promise ) {
90
+ process . on ( 'unhandledRejection' , function ( reason ) {
91
91
log . error ( reason . stack ) ;
92
92
process . exit ( 1 ) ;
93
93
} ) ;
@@ -159,7 +159,7 @@ dbmigrate.prototype = {
159
159
*
160
160
* Defaults to up all migrations if no count is given.
161
161
*/
162
- up : function ( specification , scope , callback ) {
162
+ up : function ( specification , opts , callback ) {
163
163
164
164
if ( arguments . length > 0 ) {
165
165
if ( typeof ( specification ) === 'string' ) {
@@ -169,10 +169,18 @@ dbmigrate.prototype = {
169
169
170
170
this . internals . argv . count = specification ;
171
171
}
172
+ else if ( typeof ( specification ) === 'function' ) {
172
173
173
- if ( scope ) {
174
+ callback = specification ;
175
+ }
174
176
175
- this . internals . migrationMode = scope ;
177
+ if ( typeof ( opts ) === 'string' ) {
178
+
179
+ this . internals . migrationMode = opts ;
180
+ }
181
+ else if ( typeof ( opts ) === 'function' ) {
182
+
183
+ callback = opts ;
176
184
}
177
185
}
178
186
@@ -184,17 +192,25 @@ dbmigrate.prototype = {
184
192
*
185
193
* Defaults to up all migrations if no count is given.
186
194
*/
187
- down : function ( specification , scope , callback ) {
195
+ down : function ( specification , opts , callback ) {
188
196
189
197
if ( arguments . length > 0 ) {
190
- if ( typeof ( arguments [ 0 ] ) === 'number' ) {
198
+ if ( typeof ( specification ) === 'number' ) {
191
199
192
200
this . internals . argv . count = arguments [ 0 ] ;
193
201
}
202
+ else if ( typeof ( specification ) === 'function' ) {
194
203
195
- if ( scope ) {
204
+ callback = specification ;
205
+ }
196
206
197
- this . internals . migrationMode = scope ;
207
+ if ( typeof ( opts ) === 'string' ) {
208
+
209
+ this . internals . migrationMode = opts ;
210
+ }
211
+ else if ( typeof ( opts ) === 'function' ) {
212
+
213
+ callback = opts ;
198
214
}
199
215
}
200
216
@@ -206,10 +222,14 @@ dbmigrate.prototype = {
206
222
*/
207
223
reset : function ( scope , callback ) {
208
224
209
- if ( scope ) {
225
+ if ( typeof ( scope ) === 'string' ) {
210
226
211
227
this . internals . migrationMode = scope ;
212
228
}
229
+ else if ( typeof ( scope ) === 'function' ) {
230
+
231
+ callback = scope ;
232
+ }
213
233
214
234
this . internals . argv . count = Number . MAX_VALUE ;
215
235
executeDown ( this . internals , this . config , callback ) ;
0 commit comments