Commit 855ee3a8 authored by zYne's avatar zYne

--no commit message

--no commit message
parent 89fa42e8
...@@ -384,19 +384,19 @@ class Doctrine_Export_Mysql extends Doctrine_Export ...@@ -384,19 +384,19 @@ class Doctrine_Export_Mysql extends Doctrine_Export
* @throws PDOException * @throws PDOException
* @return void * @return void
*/ */
public function createIndex($table, $name, array $definition, $type = null) public function createIndexSql($table, $name, array $definition)
{ {
$table = $table; $table = $table;
$name = $this->conn->getIndexName($name); $name = $this->conn->getIndexName($name);
$type = '';
if(isset($type)) { if(isset($definition['type'])) {
switch (strtolower($type)) { switch (strtolower($definition['type'])) {
case 'fulltext': case 'fulltext':
case 'unique': case 'unique':
$type = strtoupper($type) . ' '; $type = strtoupper($definition['type']) . ' ';
break; break;
default: default:
throw new Doctrine_Export_Exception('Unknown index type ' . $type); throw new Doctrine_Export_Exception('Unknown index type ' . $definition['type']);
} }
} }
$query = 'CREATE ' . $type . 'INDEX ' . $name . ' ON ' . $table; $query = 'CREATE ' . $type . 'INDEX ' . $name . ' ON ' . $table;
...@@ -412,7 +412,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export ...@@ -412,7 +412,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
} }
$query .= ' ('. implode(', ', $fields) . ')'; $query .= ' ('. implode(', ', $fields) . ')';
return $this->conn->exec($query); return $query;
} }
/** /**
* drop existing index * drop existing index
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment