Skip to content

Commit 84a0538

Browse files
Merge pull request #86 from IzikLisbon/master
OptimisticLocking property: number --> number|string
2 parents 93e6281 + c5b4d7e commit 84a0538

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/interfaces/IDefineOptions.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ export interface IDefineOptions extends DefineOptions<any> {
44
modelName?: string;
55

66
/**
7-
* To enable optimistic locking.
7+
* Enable optimistic locking. When enabled, sequelize will add a version count attribute
8+
* to the model and throw an OptimisticLockingError error when stale instances are saved.
9+
* Set to true or a string with the attribute name you want to use to enable.
810
*/
9-
version?: boolean;
11+
version?: boolean | string;
1012
}

lib/models/Model.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ export declare class Model<T> extends Hooks {
469469
/**
470470
* version number automatically created by sequelize if table options.version is true
471471
*/
472-
version?: number;
472+
version?: number|any;
473473

474474
/**
475475
* Returns true if this instance has not yet been persisted to the database

0 commit comments

Comments
 (0)