abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); $this->addSql('DROP INDEX search_name_code'); } public function up(Schema $schema): void { $this->abortIf('postgresql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'postgresql\'.'); try { $this->addSql('CREATE EXTENSION IF NOT EXISTS pg_trgm'); $this->addSql('CREATE INDEX search_name_code ON chill_main_postal_code USING GIN (LOWER(code) gin_trgm_ops, LOWER(label) gin_trgm_ops)'); } catch (\Exception) { $this->skipIf(true, 'Could not create extension pg_trgm'); } } }