3 module.exports = function(sequelize, DataTypes) {
4 var VoiceMusicOnHold = sequelize.define('VoiceMusicOnHold', {
6 type: DataTypes.STRING,
11 type: DataTypes.ENUM('custom', 'files', 'mp3nb', 'quietmp3nb', 'quietmp3', 'mp3'),
16 type: DataTypes.STRING,
20 type: DataTypes.STRING,
24 type: DataTypes.STRING,
28 type: DataTypes.STRING,
33 type: DataTypes.STRING,
41 type: DataTypes.BOOLEAN,
45 tableName: 'voice_musiconhold'
48 VoiceMusicOnHold.beforeUpdate(function(moh) {
49 if (moh.changed('name')) {
51 message: "You can't modify a moh class name"
57 VoiceMusicOnHold.beforeDelete(function(moh) {
58 if (moh.defaultEntry) {
60 message: "You can't delete a default moh class"
65 return VoiceMusicOnHold;