aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-12-23 11:55:51 +0100
committerChocobozzz <me@florianbigard.com>2019-12-23 13:44:24 +0100
commit611a72ae15ff0cd67e5abba215c8f8566652eb98 (patch)
tree2189715298b278e210a192db71e2f71f6403c3db /server/models
parent0dfee3a3ac8fbf53236c74fd7eca37dbe97e3128 (diff)
downloadPeerTube-611a72ae15ff0cd67e5abba215c8f8566652eb98.tar.gz
PeerTube-611a72ae15ff0cd67e5abba215c8f8566652eb98.tar.zst
PeerTube-611a72ae15ff0cd67e5abba215c8f8566652eb98.zip
Add index for recently added SQL query
Diffstat (limited to 'server/models')
-rw-r--r--server/models/video/video.ts7
1 files changed, 6 insertions, 1 deletions
diff --git a/server/models/video/video.ts b/server/models/video/video.ts
index 913d2d4a9..e58146ccf 100644
--- a/server/models/video/video.ts
+++ b/server/models/video/video.ts
@@ -149,7 +149,12 @@ const indexes: (ModelIndexesOptions & { where?: WhereOptions })[] = [
149 buildTrigramSearchIndex('video_name_trigram', 'name'), 149 buildTrigramSearchIndex('video_name_trigram', 'name'),
150 150
151 { fields: [ 'createdAt' ] }, 151 { fields: [ 'createdAt' ] },
152 { fields: [ 'publishedAt' ] }, 152 {
153 fields: [
154 { name: 'publishedAt', order: 'DESC' },
155 { name: 'id', order: 'ASC' }
156 ]
157 },
153 { fields: [ 'duration' ] }, 158 { fields: [ 'duration' ] },
154 { fields: [ 'views' ] }, 159 { fields: [ 'views' ] },
155 { fields: [ 'channelId' ] }, 160 { fields: [ 'channelId' ] },