diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-08-25 18:36:49 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-08-25 18:36:49 +0200 |
commit | 556ddc319242aafef51bae9301423ecf8701a3af (patch) | |
tree | 413829b522193584df348f0356a702b3222c3419 /server/models/pod | |
parent | d15ab38a905e6b50972e6f884917db9198279daf (diff) | |
download | PeerTube-556ddc319242aafef51bae9301423ecf8701a3af.tar.gz PeerTube-556ddc319242aafef51bae9301423ecf8701a3af.tar.zst PeerTube-556ddc319242aafef51bae9301423ecf8701a3af.zip |
Upgrade common server dependencies
Diffstat (limited to 'server/models/pod')
-rw-r--r-- | server/models/pod/pod-interface.ts | 2 | ||||
-rw-r--r-- | server/models/pod/pod.ts | 6 |
2 files changed, 3 insertions, 5 deletions
diff --git a/server/models/pod/pod-interface.ts b/server/models/pod/pod-interface.ts index 8b0b72167..fc763acac 100644 --- a/server/models/pod/pod-interface.ts +++ b/server/models/pod/pod-interface.ts | |||
@@ -42,6 +42,7 @@ export interface PodClass { | |||
42 | } | 42 | } |
43 | 43 | ||
44 | export interface PodAttributes { | 44 | export interface PodAttributes { |
45 | id?: number | ||
45 | host?: string | 46 | host?: string |
46 | publicKey?: string | 47 | publicKey?: string |
47 | score?: number | Sequelize.literal // Sequelize literal for 'score +' + value | 48 | score?: number | Sequelize.literal // Sequelize literal for 'score +' + value |
@@ -49,7 +50,6 @@ export interface PodAttributes { | |||
49 | } | 50 | } |
50 | 51 | ||
51 | export interface PodInstance extends PodClass, PodAttributes, Sequelize.Instance<PodAttributes> { | 52 | export interface PodInstance extends PodClass, PodAttributes, Sequelize.Instance<PodAttributes> { |
52 | id: number | ||
53 | createdAt: Date | 53 | createdAt: Date |
54 | updatedAt: Date | 54 | updatedAt: Date |
55 | 55 | ||
diff --git a/server/models/pod/pod.ts b/server/models/pod/pod.ts index 56918e358..df6412721 100644 --- a/server/models/pod/pod.ts +++ b/server/models/pod/pod.ts | |||
@@ -143,7 +143,7 @@ list = function () { | |||
143 | } | 143 | } |
144 | 144 | ||
145 | listAllIds = function (transaction: Sequelize.Transaction) { | 145 | listAllIds = function (transaction: Sequelize.Transaction) { |
146 | const query: Sequelize.FindOptions = { | 146 | const query = { |
147 | attributes: [ 'id' ], | 147 | attributes: [ 'id' ], |
148 | transaction | 148 | transaction |
149 | } | 149 | } |
@@ -170,9 +170,7 @@ listRandomPodIdsWithRequest = function (limit: number, tableWithPods: string, ta | |||
170 | limit: limit, | 170 | limit: limit, |
171 | where: { | 171 | where: { |
172 | id: { | 172 | id: { |
173 | $in: [ | 173 | $in: Sequelize.literal(`(SELECT DISTINCT "${tableWithPods}"."podId" FROM "${tableWithPods}" ${tableWithPodsJoins})`) |
174 | Sequelize.literal(`SELECT DISTINCT "${tableWithPods}"."podId" FROM "${tableWithPods}" ${tableWithPodsJoins}`) | ||
175 | ] | ||
176 | } | 174 | } |
177 | } | 175 | } |
178 | } | 176 | } |