aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/video')
-rw-r--r--server/models/video/author.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/models/video/author.ts b/server/models/video/author.ts
index c30cc306d..fd0f44f6b 100644
--- a/server/models/video/author.ts
+++ b/server/models/video/author.ts
@@ -71,6 +71,14 @@ function associate (models) {
71 }, 71 },
72 onDelete: 'cascade' 72 onDelete: 'cascade'
73 }) 73 })
74
75 Author.hasMany(models.Video, {
76 foreignKey: {
77 name: 'authorId',
78 allowNull: false
79 },
80 onDelete: 'cascade'
81 })
74} 82}
75 83
76findOrCreateAuthor = function (name: string, podId: number, userId: number, transaction: Sequelize.Transaction) { 84findOrCreateAuthor = function (name: string, podId: number, userId: number, transaction: Sequelize.Transaction) {