]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/author.ts
Begin tests for user quota
[github/Chocobozzz/PeerTube.git] / server / models / video / author.ts
index c30cc306df0f7d3db8aae722f1e1b375adf21c05..fd0f44f6b2e74a80699dd4fde49deffcd18524cf 100644 (file)
@@ -71,6 +71,14 @@ function associate (models) {
     },
     onDelete: 'cascade'
   })
+
+  Author.hasMany(models.Video, {
+    foreignKey: {
+      name: 'authorId',
+      allowNull: false
+    },
+    onDelete: 'cascade'
+  })
 }
 
 findOrCreateAuthor = function (name: string, podId: number, userId: number, transaction: Sequelize.Transaction) {