]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/requestToPod.js
Server: Add postgresql indexes
[github/Chocobozzz/PeerTube.git] / server / models / requestToPod.js
index 378c2bdcf6be85849e2eb4bf044147b767ec5bcf..f42a534586471ccdfda596d2dc0004c123bd2fe1 100644 (file)
@@ -4,6 +4,18 @@
 
 module.exports = function (sequelize, DataTypes) {
   const RequestToPod = sequelize.define('RequestToPod', {}, {
+    indexes: [
+      {
+        fields: [ 'requestId' ]
+      },
+      {
+        fields: [ 'podId' ]
+      },
+      {
+        fields: [ 'requestId', 'podId' ],
+        unique: true
+      }
+    ],
     classMethods: {
       removePodOf
     }