mirror of
https://github.com/silverstripe/silverstripe-postgresql
synced 2024-09-29 20:59:01 +02:00
Use parseIndexSpec to cleanup fulltext specification
This commit is contained in:
parent
fba93bba72
commit
48c07ad1ab
@ -477,23 +477,12 @@ class PostgreSQLDatabase extends SS_Database {
|
|||||||
$fulltexts='';
|
$fulltexts='';
|
||||||
$triggers='';
|
$triggers='';
|
||||||
if($indexes){
|
if($indexes){
|
||||||
foreach($indexes as $name=>$this_index){
|
foreach($indexes as $name => $indexSpec) {
|
||||||
if(is_array($this_index) && $this_index['type']=='fulltext'){
|
$indexSpec = $this->parseIndexSpec($name, $indexSpec);
|
||||||
$ts_details=$this->fulltext($this_index, $tableName, $name);
|
if($indexSpec['type'] === 'fulltext') {
|
||||||
|
$ts_details = $this->fulltext($indexSpec, $tableName, $name);
|
||||||
$fulltexts .= $ts_details['fulltexts'] . ', ';
|
$fulltexts .= $ts_details['fulltexts'] . ', ';
|
||||||
$triggers .= $ts_details['triggers'];
|
$triggers .= $ts_details['triggers'];
|
||||||
} else if(is_string($this_index)) {
|
|
||||||
preg_match('/^fulltext\ \((.+)\)$/i', $this_index, $matches);
|
|
||||||
if(count($matches) == 2) {
|
|
||||||
$index = array(
|
|
||||||
'type' => 'fulltext',
|
|
||||||
'name' => $name,
|
|
||||||
'value' => $matches[1]
|
|
||||||
);
|
|
||||||
$ts_details=$this->fulltext($index, $tableName, $name);
|
|
||||||
$fulltexts.=$ts_details['fulltexts'] . ', ';
|
|
||||||
$triggers.=$ts_details['triggers'];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user