3 module.exports = function(sequelize, DataTypes) {
4 var OpenchannelAccount = sequelize.define('OpenchannelAccount', {
11 remote: DataTypes.STRING,
13 type: DataTypes.BOOLEAN,
17 type: DataTypes.INTEGER,
21 // // type: DataTypes.INTEGER,
23 // type: DataTypes.STRING,
30 type: DataTypes.STRING
33 type: DataTypes.STRING
36 type: DataTypes.STRING
39 type: DataTypes.ENUM('GET', 'POST')
42 type: DataTypes.ENUM('GET', 'POST')
45 type: DataTypes.ENUM('GET', 'POST')
48 type: DataTypes.STRING,
50 return this.getDataValue('actions') ? JSON.parse(this.getDataValue('actions')) : [];
53 return this.setDataValue('actions', JSON.stringify(val));
57 type: DataTypes.BOOLEAN,
61 tableName: 'openchannel_accounts',
62 associate: function(models) {
63 OpenchannelAccount.hasMany(models.OpenchannelRoom);
64 OpenchannelAccount.hasMany(models.OpenchannelApplication, {
67 OpenchannelAccount.hasMany(models.OpenchannelMessage);
69 OpenchannelAccount.hasMany(models.OpenchannelDisposition);
70 OpenchannelAccount.belongsTo(models.List);
71 OpenchannelAccount.addScope('default', {
73 model: models.OpenchannelApplication,
83 model: models.OpenchannelQueue
89 return OpenchannelAccount;