diff --git a/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql b/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql index 3c61dd289d2..f553a8c6a97 100644 --- a/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql +++ b/bootstrap/sql/migrations/native/1.5.0/postgres/schemaChanges.sql @@ -277,7 +277,7 @@ jsonb_build_array(json#>'{dataModel,owner}')) where json #>> '{dataModel,owner}' CREATE INDEX IF NOT EXISTS extension_index ON entity_extension (extension); -- Remove SearchIndexing for api Service, collection and endpoint -DELETE er FROM entity_relationship er JOIN installed_apps ia ON er.fromId = ia.id OR er.toId = ia.id WHERE ia.name = 'SearchIndexingApplication'; -DELETE er FROM entity_relationship er JOIN apps_marketplace ia ON er.fromId = ia.id OR er.toId = ia.id WHERE ia.name = 'SearchIndexingApplication'; +DELETE FROM entity_relationship er USING installed_apps ia WHERE (er.fromId = ia.id OR er.toId = ia.id) AND ia.name = 'SearchIndexingApplication'; +DELETE FROM entity_relationship er USING apps_marketplace ia WHERE (er.fromId = ia.id OR er.toId = ia.id) AND ia.name = 'SearchIndexingApplication'; DELETE from installed_apps where name = 'SearchIndexingApplication'; DELETE from apps_marketplace where name = 'SearchIndexingApplication'; \ No newline at end of file