Built motion from commit 1038d87.|0.0.141
[motion.git] / server / models / voice_context.js
1 'use strict';
2
3
4
5 module.exports = function(sequelize, DataTypes) {
6
7   var VoiceContext = sequelize.define('VoiceContext', {
8     name: {
9       type: DataTypes.STRING,
10       unique: true
11     },
12     description: {
13       type: DataTypes.STRING,
14       allowNull: true,
15     },
16     defaultEntry: {
17       type: DataTypes.BOOLEAN,
18       defaultValue: 0
19     }
20   }, {
21     tableName: 'voice_contexts',
22     associate: function(models) {
23       VoiceContext.hasMany(models.VoiceExtension, {
24         onDelete: 'cascade',
25         hooks: true
26       });
27     }
28   });
29
30   return VoiceContext;
31 };