aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-02-16 19:24:34 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-02-16 19:24:34 +0100
commit5d67f289df4a68e35ad7e0af3c601c7db0dc7586 (patch)
treee29d74e65161cc7a0fd88a48da5579e790c5bd62
parent4793c343fd3cde3c6282ed0fb38e039b4276de0e (diff)
downloadPeerTube-5d67f289df4a68e35ad7e0af3c601c7db0dc7586.tar.gz
PeerTube-5d67f289df4a68e35ad7e0af3c601c7db0dc7586.tar.zst
PeerTube-5d67f289df4a68e35ad7e0af3c601c7db0dc7586.zip
Server: add unique to unique indexes
-rw-r--r--server/models/author.js7
-rw-r--r--server/models/pod.js3
-rw-r--r--server/models/user.js3
3 files changed, 10 insertions, 3 deletions
diff --git a/server/models/author.js b/server/models/author.js
index 7d15fb6ec..f036193c8 100644
--- a/server/models/author.js
+++ b/server/models/author.js
@@ -25,7 +25,12 @@ module.exports = function (sequelize, DataTypes) {
25 fields: [ 'podId' ] 25 fields: [ 'podId' ]
26 }, 26 },
27 { 27 {
28 fields: [ 'userId' ] 28 fields: [ 'userId' ],
29 unique: true
30 },
31 {
32 fields: [ 'name', 'podId' ],
33 unique: true
29 } 34 }
30 ], 35 ],
31 classMethods: { 36 classMethods: {
diff --git a/server/models/pod.js b/server/models/pod.js
index 6ae4b0999..575ebbc61 100644
--- a/server/models/pod.js
+++ b/server/models/pod.js
@@ -41,7 +41,8 @@ module.exports = function (sequelize, DataTypes) {
41 { 41 {
42 indexes: [ 42 indexes: [
43 { 43 {
44 fields: [ 'host' ] 44 fields: [ 'host' ],
45 unique: true
45 }, 46 },
46 { 47 {
47 fields: [ 'score' ] 48 fields: [ 'score' ]
diff --git a/server/models/user.js b/server/models/user.js
index 36ed723cc..6cb9eec3f 100644
--- a/server/models/user.js
+++ b/server/models/user.js
@@ -40,7 +40,8 @@ module.exports = function (sequelize, DataTypes) {
40 { 40 {
41 indexes: [ 41 indexes: [
42 { 42 {
43 fields: [ 'username' ] 43 fields: [ 'username' ],
44 unique: true
44 } 45 }
45 ], 46 ],
46 classMethods: { 47 classMethods: {