Beispiel #1
0
 /**
  * Synchronise columns.
  *
  * @return $this
  */
 protected function synchroniseColumns()
 {
     foreach ($this->comparator->droppedColumns() as $column) {
         $this->logger()->debug("Dropping column [{statement}] from table {table}.", ['statement' => $column->sqlStatement(), 'table' => $this->getName(true)]);
         $this->commander->dropColumn($this, $column);
     }
     foreach ($this->comparator->addedColumns() as $column) {
         $this->logger()->debug("Adding column [{statement}] into table {table}.", ['statement' => $column->sqlStatement(), 'table' => $this->getName(true)]);
         $this->commander->addColumn($this, $column);
     }
     foreach ($this->comparator->alteredColumns() as $pair) {
         /**
          * @var AbstractColumn $initial
          * @var AbstractColumn $current
          */
         list($current, $initial) = $pair;
         $this->logger()->debug("Altering column [{statement}] to [{new}] in table {table}.", ['statement' => $initial->sqlStatement(), 'new' => $current->sqlStatement(), 'table' => $this->getName(true)]);
         $this->commander->alterColumn($this, $initial, $current);
     }
     return $this;
 }