Built motion from commit 95b01fa.|0.0.70
[motion.git] / server / models / mail_application.js
1 'use strict';
2
3 module.exports = function(sequelize, DataTypes) {
4
5   var MailApplication = sequelize.define('MailApplication', {
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: 'mail_applications',
20     associate: function(models) {
21       // hasMany relations
22       MailApplication.belongsTo(models.User, {
23         onDelete: 'restrict'
24       });
25       MailApplication.belongsTo(models.Interval);
26       MailApplication.belongsTo(models.MailQueue, {
27         onDelete: 'restrict'
28       });
29       MailApplication.belongsTo(models.MailAccount, {
30         onDelete: 'restrict'
31       });
32     }
33   });
34
35   return MailApplication;
36 };