diff options
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 | } |