Built motion from commit 7afcba0.|0.0.74
[motion.git] / server / models / sms_application.js
1 'use strict';
2
3 module.exports = function(sequelize, DataTypes) {
4   return sequelize.define('SmsApplication', {
5     app: {
6       type: DataTypes.ENUM('queue', 'agent')
7     },
8     priority: {
9       type: DataTypes.INTEGER
10     },
11     timeout: {
12       type: DataTypes.INTEGER
13     },
14     interval: {
15       type: DataTypes.STRING
16     }
17   }, {
18     tableName: 'sms_applications',
19     associate: function(models) {
20       // hasMany relations
21       models.SmsApplication.belongsTo(models.User, {
22         onDelete: 'restrict'
23       });
24       models.SmsApplication.belongsTo(models.Interval);
25       models.SmsApplication.belongsTo(models.SmsQueue, {
26         onDelete: 'restrict'
27       });
28       models.SmsApplication.belongsTo(models.SmsAccount, {
29         onDelete: 'restrict'
30       });
31     }
32   });
33 };