summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Andreev <narf@devilix.net>2013-12-18 23:30:24 +0100
committerAndrey Andreev <narf@devilix.net>2013-12-18 23:30:24 +0100
commitaa25cd2769cfaed68dad8d0020997cf148c20eb4 (patch)
tree046b04e2ecc43cbf3f9649b19fe20a198b75a571
parentcfde6f2397bd598a9eaa5a142a06da06770de751 (diff)
parentd3a6ca207f5851852a4d0de7c70c861434f70c5c (diff)
Merge pull request #2779 from mjnaderi/develop
Use table name as a prefix for index names
-rw-r--r--system/database/DB_forge.php5
1 files changed, 2 insertions, 3 deletions
diff --git a/system/database/DB_forge.php b/system/database/DB_forge.php
index bec8d5554..1cebb189c 100644
--- a/system/database/DB_forge.php
+++ b/system/database/DB_forge.php
@@ -984,7 +984,6 @@ abstract class CI_DB_forge {
*/
protected function _process_indexes($table)
{
- $table = $this->db->escape_identifiers($table);
$sqls = array();
for ($i = 0, $c = count($this->keys); $i < $c; $i++)
@@ -1008,8 +1007,8 @@ abstract class CI_DB_forge {
is_array($this->keys[$i]) OR $this->keys[$i] = array($this->keys[$i]);
- $sqls[] = 'CREATE INDEX '.$this->db->escape_identifiers(implode('_', $this->keys[$i]))
- .' ON '.$table
+ $sqls[] = 'CREATE INDEX '.$this->db->escape_identifiers($table.'_'.implode('_', $this->keys[$i]))
+ .' ON '.$this->db->escape_identifiers($table)
.' ('.implode(', ', $this->db->escape_identifiers($this->keys[$i])).');';
}