Merge pull request #4183 from ggarek/feature/sequelize-belongs-to-many

feat(sequelize): add belongsToMany definition
This commit is contained in:
Horiuchi_H
2015-04-24 09:14:36 +09:00
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -101,6 +101,8 @@ model.belongsTo<modelInst, modelPojo>(model);
model.belongsTo<modelInst, modelPojo>(model, assocOpts);
model.hasMany<modelInst, modelPojo>(model);
model.hasMany<modelInst, modelPojo>(model, assocOpts);
model.belongsToMany<modelInst, modelPojo>(model);
model.belongsToMany<modelInst, modelPojo>(model, assocOpts);
promiseMe = model.sync();
promiseMe = model.drop(dropOpts);
+8
View File
@@ -909,6 +909,14 @@ declare module "sequelize"
*/
belongsTo<TInstance, TPojo>(target: Model<TInstance, TPojo>, options?: AssociationOptions): void;
/**
* Creates an association to connect sources with multiple targets. Furthermore the targets can also have connections to multiple sources.
*
* @param target
* @param options
*/
belongsToMany<TInstance, TPojo>(target: Model<TInstance, TPojo>, options?: AssociationOptions): void;
/**
* Create an association that is either 1:m or n:m.
*