|
@@ 426-442 (lines=17) @@
|
| 423 |
|
* @param AbstractTable $table |
| 424 |
|
* @param StateComparator $comparator |
| 425 |
|
*/ |
| 426 |
|
protected function alterForeigns(AbstractTable $table, StateComparator $comparator) |
| 427 |
|
{ |
| 428 |
|
foreach ($comparator->alteredForeigns() as $pair) { |
| 429 |
|
/** |
| 430 |
|
* @var AbstractReference $initial |
| 431 |
|
* @var AbstractReference $current |
| 432 |
|
*/ |
| 433 |
|
list($current, $initial) = $pair; |
| 434 |
|
|
| 435 |
|
$this->log('Altering foreign key [{statement}] to [{new}] in {table}.', [ |
| 436 |
|
'statement' => $initial->sqlStatement($this->driver), |
| 437 |
|
'table' => $this->identify($table), |
| 438 |
|
]); |
| 439 |
|
|
| 440 |
|
$this->alterForeign($table, $initial, $current); |
| 441 |
|
} |
| 442 |
|
} |
| 443 |
|
|
| 444 |
|
/** |
| 445 |
|
* @param AbstractTable $table |
|
@@ 464-481 (lines=18) @@
|
| 461 |
|
* @param AbstractTable $table |
| 462 |
|
* @param StateComparator $comparator |
| 463 |
|
*/ |
| 464 |
|
protected function alterIndexes(AbstractTable $table, StateComparator $comparator) |
| 465 |
|
{ |
| 466 |
|
foreach ($comparator->alteredIndexes() as $pair) { |
| 467 |
|
/** |
| 468 |
|
* @var AbstractIndex $initial |
| 469 |
|
* @var AbstractIndex $current |
| 470 |
|
*/ |
| 471 |
|
list($current, $initial) = $pair; |
| 472 |
|
|
| 473 |
|
$this->log('Altering index [{statement}] to [{new}] in table {table}.', [ |
| 474 |
|
'statement' => $initial->sqlStatement($this->driver), |
| 475 |
|
'new' => $current->sqlStatement($this->driver), |
| 476 |
|
'table' => $this->identify($table), |
| 477 |
|
]); |
| 478 |
|
|
| 479 |
|
$this->alterIndex($table, $initial, $current); |
| 480 |
|
} |
| 481 |
|
} |
| 482 |
|
|
| 483 |
|
/** |
| 484 |
|
* @param AbstractTable $table |
|
@@ 503-520 (lines=18) @@
|
| 500 |
|
* @param AbstractTable $table |
| 501 |
|
* @param StateComparator $comparator |
| 502 |
|
*/ |
| 503 |
|
protected function alterColumns(AbstractTable $table, StateComparator $comparator) |
| 504 |
|
{ |
| 505 |
|
foreach ($comparator->alteredColumns() as $pair) { |
| 506 |
|
/** |
| 507 |
|
* @var AbstractColumn $initial |
| 508 |
|
* @var AbstractColumn $current |
| 509 |
|
*/ |
| 510 |
|
list($current, $initial) = $pair; |
| 511 |
|
|
| 512 |
|
$this->log('Altering column [{statement}] to [{new}] in table {table}.', [ |
| 513 |
|
'statement' => $initial->sqlStatement($this->driver), |
| 514 |
|
'new' => $current->sqlStatement($this->driver), |
| 515 |
|
'table' => $this->identify($table), |
| 516 |
|
]); |
| 517 |
|
|
| 518 |
|
$this->alterColumn($table, $initial, $current); |
| 519 |
|
} |
| 520 |
|
} |
| 521 |
|
|
| 522 |
|
/** |
| 523 |
|
* @param AbstractTable $table |