aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/models/utils.ts')
-rw-r--r--server/models/utils.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/server/models/utils.ts b/server/models/utils.ts
index a06d57831..143c1a23c 100644
--- a/server/models/utils.ts
+++ b/server/models/utils.ts
@@ -113,7 +113,8 @@ function throwIfNotValid (value: any, validator: (value: any) => boolean, fieldN
113function buildTrigramSearchIndex (indexName: string, attribute: string) { 113function buildTrigramSearchIndex (indexName: string, attribute: string) {
114 return { 114 return {
115 name: indexName, 115 name: indexName,
116 fields: [ Sequelize.literal('lower(immutable_unaccent(' + attribute + '))') as any ], 116 // FIXME: gin_trgm_ops is not taken into account in Sequelize 6, so adding it ourselves in the literal function
117 fields: [ Sequelize.literal('lower(immutable_unaccent(' + attribute + ')) gin_trgm_ops') as any ],
117 using: 'gin', 118 using: 'gin',
118 operator: 'gin_trgm_ops' 119 operator: 'gin_trgm_ops'
119 } 120 }