public function compareIndices($caseInsensitive = false)
    {
        $indexDifferences = 0;
        $fromTableIndices = array_merge($this->getFromTable()->getIndices(), $this->getFromTable()->getUnices());
        $toTableIndices = array_merge($this->getToTable()->getIndices(), $this->getToTable()->getUnices());

        foreach ($toTableIndices as $toTableIndexPos => $toTableIndex) {
            foreach ($fromTableIndices as $fromTableIndexPos => $fromTableIndex) {
                if (PropelIndexComparator::computeDiff($fromTableIndex, $toTableIndex, $caseInsensitive) === false) {
                    unset($fromTableIndices[$fromTableIndexPos]);
                    unset($toTableIndices[$toTableIndexPos]);
                } else {
                    $test = $caseInsensitive ?
                        strtolower($fromTableIndex->getName()) == strtolower($toTableIndex->getName()) :
                        $fromTableIndex->getName() == $toTableIndex->getName();
                    if ($test) {
                        // same name, but different columns
                        $this->tableDiff->addModifiedIndex($fromTableIndex->getName(), $fromTableIndex, $toTableIndex);
                        unset($fromTableIndices[$fromTableIndexPos]);
                        unset($toTableIndices[$toTableIndexPos]);
                        $indexDifferences++;
                    }
                }
            }
        }

        foreach ($fromTableIndices as $fromTableIndexPos => $fromTableIndex) {
            $this->tableDiff->addRemovedIndex($fromTableIndex->getName(), $fromTableIndex);
            $indexDifferences++;
        }

        foreach ($toTableIndices as $toTableIndexPos => $toTableIndex) {
            $this->tableDiff->addAddedIndex($toTableIndex->getName(), $toTableIndex);
            $indexDifferences++;
        }

        return $indexDifferences;
    }