abstract unique index creation
This commit is contained in:
parent
45d090054b
commit
cef7257ec8
@ -238,9 +238,10 @@ class SQLite extends DBEngine {
|
|||||||
$extras = "";
|
$extras = "";
|
||||||
foreach(explode(",", $data) as $bit) {
|
foreach(explode(",", $data) as $bit) {
|
||||||
$matches = array();
|
$matches = array();
|
||||||
if(preg_match("/INDEX\s*\((.*)\)/", $bit, $matches)) {
|
if(preg_match("/(UNIQUE)? ?INDEX\s*\((.*)\)/", $bit, $matches)) {
|
||||||
$col = $matches[1];
|
$uni = $matches[1];
|
||||||
$extras .= "CREATE INDEX {$name}_{$col} on {$name}({$col});";
|
$col = $matches[2];
|
||||||
|
$extras .= "CREATE $uni INDEX {$name}_{$col} ON {$name}({$col});";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
$cols[] = $bit;
|
$cols[] = $bit;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user