]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/video/video-blacklist.ts
Use global uuid instead of remoteId for videos
[github/Chocobozzz/PeerTube.git] / server / models / video / video-blacklist.ts
index 8c42dbc21fbb2dc74681e5bb7c9ea7e9cf17cd72..4d1b45aa57d91a7626055a76db6f8557a9403501 100644 (file)
@@ -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