Merge pull request #1761 from umami-software/bug/um-165-rename-index-fix

add current database filter  when querying index
This commit is contained in:
Mike Cao 2023-01-25 08:37:06 -08:00 committed by GitHub
commit 58a380d6e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -68,7 +68,8 @@ CREATE PROCEDURE `UmamiRenameIndexIfExists`(
INFORMATION_SCHEMA.STATISTICS
WHERE
TABLE_NAME = @tableName
AND INDEX_NAME = @currentIndexName;
AND INDEX_NAME = @currentIndexName
AND TABLE_SCHEMA = database();
SET @query = CONCAT(
'ALTER TABLE `', @tableName, '` RENAME INDEX `', @currentIndexName, '` TO `', @newIndexName, '`;'