mirror of
https://github.com/strapi/strapi.git
synced 2025-09-26 17:00:55 +00:00
Add IF NOT EXISTS parameter for creating indexes in postgresql case
This commit is contained in:
parent
a9e0e920f5
commit
bf7809f3dd
@ -479,7 +479,7 @@ module.exports = function(strapi) {
|
|||||||
? column
|
? column
|
||||||
: `"${column}"`;
|
: `"${column}"`;
|
||||||
|
|
||||||
return ORM.knex.raw(`CREATE INDEX search_${_.toLower(indexName)} ON "${table}" USING gin(${attribute} gin_trgm_ops)`);
|
return ORM.knex.raw(`CREATE INDEX IF NOT EXISTS search_${_.toLower(indexName)} ON "${table}" USING gin(${attribute} gin_trgm_ops)`);
|
||||||
});
|
});
|
||||||
|
|
||||||
await Promise.all(indexes);
|
await Promise.all(indexes);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user