Built motion from commit 1038d87.|0.0.141
[motion.git] / server / models / voice_context.js
index 56d2691..2386fcc 100644 (file)
@@ -1,6 +1,6 @@
-/**
- * Context Model
- */
+'use strict';
+
+
 
 module.exports = function(sequelize, DataTypes) {
 
@@ -18,7 +18,13 @@ module.exports = function(sequelize, DataTypes) {
       defaultValue: 0
     }
   }, {
-    tableName: 'voice_contexts'
+    tableName: 'voice_contexts',
+    associate: function(models) {
+      VoiceContext.hasMany(models.VoiceExtension, {
+        onDelete: 'cascade',
+        hooks: true
+      });
+    }
   });
 
   return VoiceContext;