From 0a6658fdcbd779ada8f3758048c326e997902d5a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Jul 2017 16:01:56 +0200 Subject: Use global uuid instead of remoteId for videos --- server/models/video/video-blacklist.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'server/models/video/video-blacklist.ts') diff --git a/server/models/video/video-blacklist.ts b/server/models/video/video-blacklist.ts index 8c42dbc21..4d1b45aa5 100644 --- a/server/models/video/video-blacklist.ts +++ b/server/models/video/video-blacklist.ts @@ -60,8 +60,11 @@ toFormatedJSON = function (this: BlacklistedVideoInstance) { function associate (models) { BlacklistedVideo.belongsTo(models.Video, { - foreignKey: 'videoId', - onDelete: 'cascade' + foreignKey: { + name: 'videoId', + allowNull: false + }, + onDelete: 'CASCADE' }) } @@ -92,7 +95,7 @@ loadById = function (id: number) { return BlacklistedVideo.findById(id) } -loadByVideoId = function (id: string) { +loadByVideoId = function (id: number) { const query = { where: { videoId: id -- cgit v1.2.3