UNPKG

sequelize-typescript

Version:

Decorators and some other extras for sequelize (v3 + v4)

27 lines (26 loc) 844 B
/// <reference types="sequelize" /> import { AssociationScope } from 'sequelize'; import { ModelClassGetter } from '../types/ModelClassGetter'; /** * Used for a association table in n:m associations. * * @see AssociationOptionsBelongsToMany */ export interface IThroughOptions { /** * The model used to join both sides of the N:M association. */ model: ModelClassGetter | string; /** * 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; }