the order of returned values was flipped

This commit is contained in:
Nick Schultz
2018-03-14 09:05:42 -04:00
parent 3c5b3e9908
commit 8c71e13cc7
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -4006,9 +4006,9 @@ declare namespace sequelize {
* whether the row was inserted or not.
*/
upsert(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise<boolean>;
upsert(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[boolean, TInstance]>;
upsert(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>;
insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: false | undefined }): Promise<boolean>;
insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[boolean, TInstance]>;
insertOrUpdate(values: TAttributes, options?: UpsertOptions & { returning: true }): Promise<[TInstance, boolean]>;
/**
* Create and insert multiple instances in bulk.
+1 -1
View File
@@ -1044,7 +1044,7 @@ findOrRetVal = User.findOrCreate( { where : { email : 'unique.email.@d.com', com
findOrRetVal = User.findOrCreate( { where : { objectId : 1 }, defaults : { bool : false } } );
let upsertPromiseNoOptions: Bluebird<boolean> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) } );
let upsertPromiseReturning: Bluebird<[boolean, AnyInstance]> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: true } );
let upsertPromiseReturning: Bluebird<[AnyInstance, boolean]> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: true } );
let upsertPromiseNotReturning: Bluebird<boolean> = User.upsert( { id : 42, username : 'doe', foo : s.fn( 'upper', 'mixedCase2' ) }, { returning: false } );
User.bulkCreate( [{ aNumber : 10 }, { aNumber : 12 }] ).then( ( i ) => i[0].isNewRecord );