From bd9beb540b36556a044a5e3460850c6a99859f8c Mon Sep 17 00:00:00 2001 From: id0181 Date: Wed, 13 Dec 2017 13:04:03 -0500 Subject: [PATCH] Add sourceKey property to AssociationOptionsHasMany interface According to http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-hasMany, Model.hasMany should have an sourceKey property. But for now, no sourceKey property for an 1 to Many association exists --- types/sequelize/index.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/types/sequelize/index.d.ts b/types/sequelize/index.d.ts index b7bf448aed..dae8b3475c 100644 --- a/types/sequelize/index.d.ts +++ b/types/sequelize/index.d.ts @@ -7,6 +7,7 @@ // Patsakol Tangjitcharoenchai // Sebastien Bramille // Nick Mueller +// Philippe D'Alva // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -1329,7 +1330,13 @@ declare namespace sequelize { * A string or a data type to represent the identifier in the table */ keyType?: DataTypeAbstract; - + /** + * A string to represent the name of the field to use as the key for an 1 to many association in the source table. + * + * @see http://docs.sequelizejs.com/class/lib/model.js~Model.html#static-method-hasMany + * @see https://github.com/sequelize/sequelize/blob/b4fd46426db9cdbb97074bea121203d565e4195d/lib/associations/has-many.js#L81 + */ + sourceKey?: string; } /**