BUG Normalize index specs to avoid false positives on schema regen
This commit is contained in:
parent
36f15a52b4
commit
069ed7ff52
|
@ -538,7 +538,16 @@ class SQLite3Database extends SS_Database {
|
|||
foreach(DB::query('PRAGMA index_info("' . $index["name"] . '")') as $details) $list[] = $details['name'];
|
||||
$indexList[$index["name"]] = implode(',', $list);
|
||||
}
|
||||
foreach($indexList as $name => $val) $indexList[$name] = "\"$val\"";
|
||||
foreach($indexList as $name => $val) {
|
||||
// Normalize quoting to avoid false positives when checking for index changes
|
||||
// during schema generation
|
||||
$valParts = preg_split('/\s*,\s*/', $val);
|
||||
foreach($valParts as $i => $valPart) {
|
||||
$valParts[$i] = preg_replace('/^"?(.*)"?$/', '$1', $valPart);
|
||||
}
|
||||
|
||||
$indexList[$name] = '"' . implode('","', $valParts) . '"';
|
||||
}
|
||||
|
||||
return $indexList;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue