From a4a54e75e98173e25cec3672cb3f93d5532bccff Mon Sep 17 00:00:00 2001 From: Abdul Majid <74697541+Abdul-Majid10@users.noreply.github.com> Date: Thu, 2 Nov 2023 16:49:31 +0500 Subject: [PATCH] Fix "Syntax error or access violation: Duplicate key name" If we apply fulltext index and unique constraint on same column. --- lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php index ed3d0949841da..93b833f8f49aa 100644 --- a/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php +++ b/lib/internal/Magento/Framework/DB/Adapter/Pdo/Mysql.php @@ -3578,7 +3578,7 @@ public function getIndexName($tableName, $fields, $indexType = '') default: $prefix = 'idx_'; } - return strtoupper(ExpressionConverter::shortenEntityName($tableName . '_' . $fields, $prefix)); + return strtoupper(ExpressionConverter::shortenEntityName($tableName . '_' . $fields . substr("_" . $prefix, 0, -1), $prefix)); } /**