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.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/initializers/database.ts b/server/initializers/database.ts
index d1744d21f..d9a265e7a 100644
--- a/server/initializers/database.ts
+++ b/server/initializers/database.ts
@@ -140,15 +140,15 @@ async function checkPostgresExtensions () {
140} 140}
141 141
142async function checkPostgresExtension (extension: string) { 142async function checkPostgresExtension (extension: string) {
143 const query = `SELECT true AS enabled FROM pg_available_extensions WHERE name = '${extension}' AND installed_version IS NOT NULL;` 143 const query = `SELECT 1 FROM pg_available_extensions WHERE name = '${extension}' AND installed_version IS NOT NULL;`
144 const options = { 144 const options = {
145 type: QueryTypes.SELECT as QueryTypes.SELECT, 145 type: QueryTypes.SELECT as QueryTypes.SELECT,
146 raw: true 146 raw: true
147 } 147 }
148 148
149 const res = await sequelizeTypescript.query<{ enabled: boolean }>(query, options) 149 const res = await sequelizeTypescript.query<object>(query, options)
150 150
151 if (!res || res.length === 0 || res[ 0 ][ 'enabled' ] !== true) { 151 if (!res || res.length === 0) {
152 // Try to create the extension ourselves 152 // Try to create the extension ourselves
153 try { 153 try {
154 await sequelizeTypescript.query(`CREATE EXTENSION ${extension};`, { raw: true }) 154 await sequelizeTypescript.query(`CREATE EXTENSION ${extension};`, { raw: true })