]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Server: add unique to unique indexes
authorChocobozzz <florian.bigard@gmail.com>
Thu, 16 Feb 2017 18:24:34 +0000 (19:24 +0100)
committerChocobozzz <florian.bigard@gmail.com>
Thu, 16 Feb 2017 18:24:34 +0000 (19:24 +0100)
server/models/author.js
server/models/pod.js
server/models/user.js

index 7d15fb6ecd92ba4baa28a8c6f9efacd5e5f521d2..f036193c839bb3426c48a73533c75ed56017415c 100644 (file)
@@ -25,7 +25,12 @@ module.exports = function (sequelize, DataTypes) {
           fields: [ 'podId' ]
         },
         {
-          fields: [ 'userId' ]
+          fields: [ 'userId' ],
+          unique: true
+        },
+        {
+          fields: [ 'name', 'podId' ],
+          unique: true
         }
       ],
       classMethods: {
index 6ae4b0999eac0ae25e9948782b8512d1a5dbe308..575ebbc61c693dd5dc65a14b5ad5162504171220 100644 (file)
@@ -41,7 +41,8 @@ module.exports = function (sequelize, DataTypes) {
     {
       indexes: [
         {
-          fields: [ 'host' ]
+          fields: [ 'host' ],
+          unique: true
         },
         {
           fields: [ 'score' ]
index 36ed723ccd1292423599e7ab069d3ffd4dac1810..6cb9eec3fd435ba247061e24194b764c34722796 100644 (file)
@@ -40,7 +40,8 @@ module.exports = function (sequelize, DataTypes) {
     {
       indexes: [
         {
-          fields: [ 'username' ]
+          fields: [ 'username' ],
+          unique: true
         }
       ],
       classMethods: {