;
}
- $sql_index = '';#$this->db()->type('table.sql.index',false);
- return $sql_replace($sql.')'.($sql_index ? ';'.$this->db()->row($sql_index) : ''));
+ $indexes = [];#$this->db()->type('table.sql.index',false);
+ foreach ($this->indexes() as $i) {
+ if (!empty($i['unique']) or !empty($i['key'])) continue;
+ $indexes[] = 'CREATE INDEX '.$i['name'].' ON '.$this->sql_name().' ('.$i['field'].')';
+ }
+ return $sql_replace($sql.')'.($indexes ? ';'.join(';',$indexes) : ''));
}
/*
// Get other indexes
$indexes = [];
foreach ($this->indexes() as $i) {
- if (empty($i['unique'])) $indexes[$i['field']] = 1;
+ if (empty($i['unique']) and empty($i['key'])) $indexes[$i['field']] = 1;
}
foreach ($rows as $row) {