|
@@ 510-528 (lines=19) @@
|
| 507 |
|
self::assertCount(1, $tableDiff->removedForeignKeys); |
| 508 |
|
} |
| 509 |
|
|
| 510 |
|
public function testTableUpdateForeignKey() |
| 511 |
|
{ |
| 512 |
|
$tableForeign = new Table("bar"); |
| 513 |
|
$tableForeign->addColumn('id', 'integer'); |
| 514 |
|
|
| 515 |
|
$table1 = new Table("foo"); |
| 516 |
|
$table1->addColumn('fk', 'integer'); |
| 517 |
|
$table1->addForeignKeyConstraint($tableForeign, array('fk'), array('id')); |
| 518 |
|
|
| 519 |
|
$table2 = new Table("foo"); |
| 520 |
|
$table2->addColumn('fk', 'integer'); |
| 521 |
|
$table2->addForeignKeyConstraint($tableForeign, array('fk'), array('id'), array('onUpdate' => 'CASCADE')); |
| 522 |
|
|
| 523 |
|
$c = new Comparator(); |
| 524 |
|
$tableDiff = $c->diffTable($table1, $table2); |
| 525 |
|
|
| 526 |
|
self::assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff); |
| 527 |
|
self::assertCount(1, $tableDiff->changedForeignKeys); |
| 528 |
|
} |
| 529 |
|
|
| 530 |
|
public function testTableRenamedForeignKey(): void |
| 531 |
|
{ |
|
@@ 530-548 (lines=19) @@
|
| 527 |
|
self::assertCount(1, $tableDiff->changedForeignKeys); |
| 528 |
|
} |
| 529 |
|
|
| 530 |
|
public function testTableRenamedForeignKey(): void |
| 531 |
|
{ |
| 532 |
|
$tableForeign = new Table("bar"); |
| 533 |
|
$tableForeign->addColumn('id', 'integer'); |
| 534 |
|
|
| 535 |
|
$table1 = new Table("foo"); |
| 536 |
|
$table1->addColumn('fk', 'integer'); |
| 537 |
|
$table1->addForeignKeyConstraint($tableForeign, array('fk'), array('id'), array(), 'fk_name1'); |
| 538 |
|
|
| 539 |
|
$table2 = new Table("foo"); |
| 540 |
|
$table2->addColumn('fk', 'integer'); |
| 541 |
|
$table2->addForeignKeyConstraint($tableForeign, array('fk'), array('id'), array(), 'fk_name2'); |
| 542 |
|
|
| 543 |
|
$c = new Comparator(); |
| 544 |
|
$tableDiff = $c->diffTable($table1, $table2); |
| 545 |
|
|
| 546 |
|
self::assertInstanceOf('Doctrine\DBAL\Schema\TableDiff', $tableDiff); |
| 547 |
|
self::assertCount(1, $tableDiff->renamedForeignKeys); |
| 548 |
|
} |
| 549 |
|
|
| 550 |
|
public function testMovedForeignKeyForeignTable() |
| 551 |
|
{ |