sequelize-typescript
Version:
Decorators and some other extras for sequelize (v3 + v4)
27 lines (26 loc) • 818 B
TypeScript
/// <reference types="sequelize" />
import { AssociationScope } from 'sequelize';
import { Model } from '../models/Model';
/**
* Used for a association table in n:m associations.
*
* @see AssociationOptionsBelongsToMany
*/
export interface IPreparedThroughOptions {
/**
* The model used to join both sides of the N:M association.
*/
model: typeof Model;
/**
* A key/value set that will be used for association create and find defaults on the through model.
* (Remember to add the attributes to the through model)
*/
scope?: AssociationScope;
/**
* If true a unique key will be generated from the foreign keys used (might want to turn this off and create
* specific unique keys when using scopes)
*
* Defaults to true
*/
unique?: boolean;
}