aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/database.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/database.ts')
-rw-r--r--server/initializers/database.ts9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/initializers/database.ts b/server/initializers/database.ts
index d95e34bce..1a9ce5a61 100644
--- a/server/initializers/database.ts
+++ b/server/initializers/database.ts
@@ -125,10 +125,11 @@ async function checkPostgresExtensions () {
125} 125}
126 126
127async function createFunctions () { 127async function createFunctions () {
128 const query = `CREATE OR REPLACE FUNCTION immutable_unaccent(varchar) 128 const query = `CREATE OR REPLACE FUNCTION immutable_unaccent(text)
129 RETURNS text AS $$ 129 RETURNS text AS
130 SELECT unaccent($1) 130$func$
131 $$ LANGUAGE sql IMMUTABLE;` 131SELECT public.unaccent('public.unaccent', $1::text)
132$func$ LANGUAGE sql IMMUTABLE;`
132 133
133 return sequelizeTypescript.query(query, { raw: true }) 134 return sequelizeTypescript.query(query, { raw: true })
134} 135}