UNPKG

@apantle/awsome-factory-associator

Version:

Provides a syntax to define factories with any kind of association.

24 lines (21 loc) 359 B
/** * Discount.js * * @description ::Represents a Discount */ const { DataTypes } = require('sequelize'); module.exports = { attributes: { percentage: { type: DataTypes.INTEGER } }, associations: () => { Discount.belongsTo(Ticket, { foreignKey: { name: 'ticket_key', allowNull: false } }); } };