Built motion from commit 06df96e on branch develop.
[motion.git] / server / models / chat_application.js
1 'use strict';
2
3 module.exports = function(sequelize, DataTypes) {
4
5   var ChatApplication = sequelize.define('ChatApplication', {
6     app: {
7       type: DataTypes.ENUM('queue', 'agent')
8     },
9     priority: {
10       type: DataTypes.INTEGER
11     },
12     timeout: {
13       type: DataTypes.INTEGER
14     },
15     interval: {
16       type: DataTypes.STRING
17     }
18   }, {
19     tableName: 'chat_applications',
20     associate: function(models) {
21       // hasMany relations
22       ChatApplication.belongsTo(models.ChatWebsite);
23       ChatApplication.belongsTo(models.Interval);
24       ChatApplication.belongsTo(models.ChatQueue);
25       ChatApplication.belongsTo(models.User);
26     }
27   });
28
29   return ChatApplication;
30 };