33c48e8616840cc14211d90a75c6521e5f949953
[motion.git] / server / models / int_freshdesk_configuration.js
1 'use strict';
2
3 module.exports = function(sequelize, DataTypes) {
4   return sequelize.define('FreshdeskConfiguration', {
5     name: DataTypes.STRING,
6     description: DataTypes.STRING
7   }, {
8     tableName: 'int_freshdesk_configurations',
9     associate: function(models) {
10       models.FreshdeskConfiguration.belongsTo(models.FreshdeskAccount, {
11         foreignKey: 'AccountId'
12       });
13       models.FreshdeskConfiguration.hasMany(models.FreshdeskField, {
14         as: 'Subject',
15         foreignKey: 'SubjectId'
16       });
17       models.FreshdeskConfiguration.hasMany(models.FreshdeskField, {
18         as: 'Description',
19         foreignKey: 'DescriptionId'
20       });
21       models.FreshdeskConfiguration.hasMany(models.FreshdeskField, {
22         as: 'Field',
23         foreignKey: 'FieldId'
24       });
25     }
26   });
27 };