handle case with keys across multiple columns with defined lengths
This commit is contained in:
1 parent
8f1f65db47
commit
ade3d6ad87
2 files changed
+49
-1
No files matched your search
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user