diff --git a/lib/interfaces/IDefineOptions.ts b/lib/interfaces/IDefineOptions.ts index c5256383..18e87a3e 100644 --- a/lib/interfaces/IDefineOptions.ts +++ b/lib/interfaces/IDefineOptions.ts @@ -4,7 +4,9 @@ export interface IDefineOptions extends DefineOptions { modelName?: string; /** - * To enable optimistic locking. + * Enable optimistic locking. When enabled, sequelize will add a version count attribute + * to the model and throw an OptimisticLockingError error when stale instances are saved. + * Set to true or a string with the attribute name you want to use to enable. */ - version?: boolean; + version?: boolean | string; } diff --git a/lib/models/Model.d.ts b/lib/models/Model.d.ts index a9b684c7..3ad8f1b8 100644 --- a/lib/models/Model.d.ts +++ b/lib/models/Model.d.ts @@ -469,7 +469,7 @@ export declare class Model extends Hooks { /** * version number automatically created by sequelize if table options.version is true */ - version?: number; + version?: number|any; /** * Returns true if this instance has not yet been persisted to the database