mirror of
https://github.com/strapi/strapi.git
synced 2025-09-20 05:52:08 +00:00
Merge pull request #2167 from entwicklerfr/enhancement/Creating-indexes-should-use-the-suffix-IF-NOT-EXISTS#1850
Add IF NOT EXISTS parameter for creating indexes with PG
This commit is contained in:
commit
ea5c63a77f
@ -479,7 +479,7 @@ module.exports = function(strapi) {
|
||||
? 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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user