%PDF- %PDF-
Direktori : /home/opti/workflow/src/models/ |
Current File : /home/opti/workflow/src/models/contact.js |
'use strict'; module.exports = (sequelize, DataTypes) => { const Contact = sequelize.define('Contact', { uuid: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4 }, orgId: DataTypes.INTEGER, personId: DataTypes.INTEGER, groupId: DataTypes.INTEGER, contactType: DataTypes.INTEGER, description: DataTypes.TEXT, partyRole: DataTypes.INTEGER, username: DataTypes.TEXT, password: DataTypes.TEXT }, {}); Contact.associate = function(models) { // associations can be defined here Contact.belongsTo(models.Person, {foreignKey: 'personId', targetKey: 'id', as: 'person'}); Contact.belongsTo(models.Group, {foreignKey: 'groupId', targetKey: 'id', as: 'group'}); }; return Contact; };