/** * Synchronise foreign keys. * * @return $this */ protected function synchroniseForeigns() { foreach ($this->comparator->addedForeigns() as $foreign) { $this->logger()->debug("Adding foreign key [{statement}] into table {table}.", ['statement' => $foreign->sqlStatement(), 'table' => $this->getName(true)]); $this->commander->addForeign($this, $foreign); } foreach ($this->comparator->alteredForeigns() as $pair) { /** * @var AbstractReference $initial * @var AbstractReference $current */ list($current, $initial) = $pair; $this->logger()->debug("Altering foreign key [{statement}] to [{new}] in {table}.", ['statement' => $initial->sqlStatement(), 'table' => $this->getName(true)]); $this->commander->alterForeign($this, $initial, $current); } return $this; }