Built motion from commit 2438401.|1.0.5
[motion.git] / server / models / mail_message.js
index ea38957..d2f2b56 100644 (file)
@@ -51,7 +51,7 @@ module.exports = function(sequelize, DataTypes) {
                },
                attachment: DataTypes.TEXT,
                text: {
-                       type: DataTypes.BLOB,
+                       type: DataTypes.BLOB('long'),
                        get: function() {
                                if (this.getDataValue('text')) {
                                        return _.toString(this.getDataValue('text'));
@@ -59,25 +59,31 @@ module.exports = function(sequelize, DataTypes) {
                        }
                },
                html: {
-                       type: DataTypes.BLOB,
+                       type: DataTypes.BLOB('long'),
                        get: function() {
                                if (this.getDataValue('html')) {
-                                       if (this.getDataValue('html')) {
-                                               return _.toString(this.getDataValue('html'));
-                                       }
+                                       return _.toString(this.getDataValue('html'));
                                }
-                       },
+                       }
                },
                reason: DataTypes.TEXT,
+               auto: {
+                       type: DataTypes.BOOLEAN,
+                       defaultValue: false
+               },
                status: {
-                       type: DataTypes.ENUM('SENT', 'SENDING', 'RECEIVED', 'FAILED', 'NOTE'),
+                       type: DataTypes.ENUM('SENDING', 'SENT', 'RECEIVED', 'FAILED', 'NOTE'),
                        defaultValue: 'SENDING'
                },
                retry: {
                        type: DataTypes.INTEGER,
                        defaultValue: 0
                },
-               voiceSource: DataTypes.STRING
+               voiceSource: DataTypes.STRING,
+               userName: DataTypes.STRING,
+               userFullname: DataTypes.STRING,
+               accountId: DataTypes.INTEGER,
+               accountName: DataTypes.STRING
        }, {
                tableName: 'mail_messages',
                paranoid: true,