handle case with keys across multiple columns with defined lengths

This commit is contained in:
Matthew Bucci
2024-01-11 01:28:43 -08:00
parent 8f1f65db47
commit ade3d6ad87
2 changed files with 49 additions and 1 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ class CreateTableSQLRewriter extends AbstractSQLRewriter
}
// Support for UNIQUE INDEX creation
$pattern = '/,\s*(UNIQUE |)KEY\s+(`[^`]+`|\w+)\s+\((.*?)\)(?!\))/';
$pattern = '/,\s*(UNIQUE |)KEY\s+(`[^`]+`|\w+)\s+\(((?:[^()]|\([^)]*\))*)\)/';
if(preg_match_all($pattern, $sql, $matches, PREG_SET_ORDER)) {
foreach($matches as $match) {
$unique = $match[1];