Beispiel #1
0
 /**
  * Synchronise indexes.
  *
  * @return $this
  */
 protected function synchroniseIndexes()
 {
     foreach ($this->comparator->addedIndexes() as $index) {
         $this->logger()->debug("Adding index [{statement}] into table {table}.", ['statement' => $index->sqlStatement(), 'table' => $this->getName(true)]);
         $this->commander->addIndex($this, $index);
     }
     foreach ($this->comparator->alteredIndexes() as $pair) {
         /**
          * @var AbstractIndex $initial
          * @var AbstractIndex $current
          */
         list($current, $initial) = $pair;
         $this->logger()->debug("Altering index [{statement}] to [{new}] in table {table}.", ['statement' => $initial->sqlStatement(), 'new' => $current->sqlStatement(), 'table' => $this->getName(true)]);
         $this->commander->alterIndex($this, $initial, $current);
     }
     return $this;
 }