diff --git a/applications/credhub-api/src/main/resources/db/migration/postgres/V62__drop_index_secret_name_unique.sql b/applications/credhub-api/src/main/resources/db/migration/postgres/V62__drop_index_secret_name_unique.sql new file mode 100644 index 000000000..a9f6d2651 --- /dev/null +++ b/applications/credhub-api/src/main/resources/db/migration/postgres/V62__drop_index_secret_name_unique.sql @@ -0,0 +1 @@ +DROP INDEX CONCURRENTLY IF EXISTS secret_name_unique; \ No newline at end of file diff --git a/components/credentials/src/main/kotlin/org/cloudfoundry/credhub/services/DefaultCredentialVersionDataService.kt b/components/credentials/src/main/kotlin/org/cloudfoundry/credhub/services/DefaultCredentialVersionDataService.kt index ce00858eb..66baa85fd 100644 --- a/components/credentials/src/main/kotlin/org/cloudfoundry/credhub/services/DefaultCredentialVersionDataService.kt +++ b/components/credentials/src/main/kotlin/org/cloudfoundry/credhub/services/DefaultCredentialVersionDataService.kt @@ -230,7 +230,7 @@ constructor( " SELECT credential_uuid, max(version_created_at) AS max_version_created_at\n" + " FROM credential_version\n" + " GROUP BY credential_uuid) AS credential_uuid_of_max_version_created_at\n" + - " INNER JOIN (SELECT * FROM credential WHERE lower(name) LIKE lower(?)) AS name\n" + + " INNER JOIN (SELECT * FROM credential WHERE name_lowercase LIKE lower(?)) AS name\n" + " ON credential_uuid_of_max_version_created_at.credential_uuid = name.uuid\n" + " INNER JOIN credential_version AS latest_credential_version\n" + " ON latest_credential_version.credential_uuid =\n" +