diff --git a/db/mysql/migrations/02_add_event_data/migration.sql b/db/mysql/migrations/02_add_event_data/migration.sql index b781984c..cf8705b6 100644 --- a/db/mysql/migrations/02_add_event_data/migration.sql +++ b/db/mysql/migrations/02_add_event_data/migration.sql @@ -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, '`;'