From dfdcf002a1e3142a5d80718d1a450221aad06be9 Mon Sep 17 00:00:00 2001
From: romanb <romanb@625475ce-881a-0410-a577-b389adb331d8>
Date: Fri, 19 Oct 2007 13:16:22 +0000
Subject: [PATCH] fixes for exporting indices

---
 lib/Doctrine/Export/Mysql.php | 4 ++--
 lib/Doctrine/Migration.php    | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/Doctrine/Export/Mysql.php b/lib/Doctrine/Export/Mysql.php
index 900d7c1ab..5fbd88e35 100644
--- a/lib/Doctrine/Export/Mysql.php
+++ b/lib/Doctrine/Export/Mysql.php
@@ -471,7 +471,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
     public function createIndexSql($table, $name, array $definition)
     {
         $table  = $table;
-        $name   = $this->conn->getIndexName($name);
+        $name   = $this->conn->formatter->getIndexName($name);
         $name   = $this->conn->quoteIdentifier($name);
         $type   = '';
         if (isset($definition['type'])) {
@@ -485,7 +485,7 @@ class Doctrine_Export_Mysql extends Doctrine_Export
             }
         }
         $query  = 'CREATE ' . $type . 'INDEX ' . $name . ' ON ' . $table;
-        $query .= ' (' . $this->getIndexFieldDeclarationList() . ')';
+        $query .= ' (' . $this->getIndexFieldDeclarationList($definition['fields']) . ')';
 
         return $query;
     }
diff --git a/lib/Doctrine/Migration.php b/lib/Doctrine/Migration.php
index f8e0d89ee..5fb126bb0 100644
--- a/lib/Doctrine/Migration.php
+++ b/lib/Doctrine/Migration.php
@@ -39,13 +39,13 @@ class Doctrine_Migration
                                'dropped_fks'         =>  array(),
                                'created_fks'         =>  array(),
                                'dropped_constraints' =>  array(),
+                               'removed_indexes'     =>  array(),
                                'dropped_tables'      =>  array(),
                                'added_columns'       =>  array(),
                                'renamed_columns'     =>  array(),
                                'changed_columns'     =>  array(),
                                'removed_columns'     =>  array(),
                                'added_indexes'       =>  array(),
-                               'removed_indexes'     =>  array()
                                ),
               $migrationTableName = 'migration_version',
               $migrationClassesDirectory = array(),
@@ -524,7 +524,7 @@ class Doctrine_Migration
      * @param string $array 
      * @return void
      */
-    public function addIndex($tableName, $indexName, array $options = array())
+    public function addIndex($tableName, $indexName, array $definition)
     {
         $options = get_defined_vars();