diff options
Diffstat (limited to 'server/models/video/video-blacklist.ts')
-rw-r--r-- | server/models/video/video-blacklist.ts | 9 |
1 files changed, 6 insertions, 3 deletions
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) { | |||
60 | 60 | ||
61 | function associate (models) { | 61 | function associate (models) { |
62 | BlacklistedVideo.belongsTo(models.Video, { | 62 | BlacklistedVideo.belongsTo(models.Video, { |
63 | foreignKey: 'videoId', | 63 | foreignKey: { |
64 | onDelete: 'cascade' | 64 | name: 'videoId', |
65 | allowNull: false | ||
66 | }, | ||
67 | onDelete: 'CASCADE' | ||
65 | }) | 68 | }) |
66 | } | 69 | } |
67 | 70 | ||
@@ -92,7 +95,7 @@ loadById = function (id: number) { | |||
92 | return BlacklistedVideo.findById(id) | 95 | return BlacklistedVideo.findById(id) |
93 | } | 96 | } |
94 | 97 | ||
95 | loadByVideoId = function (id: string) { | 98 | loadByVideoId = function (id: number) { |
96 | const query = { | 99 | const query = { |
97 | where: { | 100 | where: { |
98 | videoId: id | 101 | videoId: id |