|
@@ 956-973 (lines=18) @@
|
| 953 |
|
/** |
| 954 |
|
* @group DDC-1657 |
| 955 |
|
*/ |
| 956 |
|
public function testAutoIncrementSequences() |
| 957 |
|
{ |
| 958 |
|
$oldSchema = new Schema(); |
| 959 |
|
$table = $oldSchema->createTable("foo"); |
| 960 |
|
$table->addColumn("id", "integer", array("autoincrement" => true)); |
| 961 |
|
$table->setPrimaryKey(array("id")); |
| 962 |
|
$oldSchema->createSequence("foo_id_seq"); |
| 963 |
|
|
| 964 |
|
$newSchema = new Schema(); |
| 965 |
|
$table = $newSchema->createTable("foo"); |
| 966 |
|
$table->addColumn("id", "integer", array("autoincrement" => true)); |
| 967 |
|
$table->setPrimaryKey(array("id")); |
| 968 |
|
|
| 969 |
|
$c = new Comparator(); |
| 970 |
|
$diff = $c->compare($oldSchema, $newSchema); |
| 971 |
|
|
| 972 |
|
self::assertCount(0, $diff->removedSequences); |
| 973 |
|
} |
| 974 |
|
|
| 975 |
|
|
| 976 |
|
/** |
|
@@ 980-997 (lines=18) @@
|
| 977 |
|
* Check that added autoincrement sequence is not populated in newSequences |
| 978 |
|
* @group DBAL-562 |
| 979 |
|
*/ |
| 980 |
|
public function testAutoIncrementNoSequences() |
| 981 |
|
{ |
| 982 |
|
$oldSchema = new Schema(); |
| 983 |
|
$table = $oldSchema->createTable("foo"); |
| 984 |
|
$table->addColumn("id", "integer", array("autoincrement" => true)); |
| 985 |
|
$table->setPrimaryKey(array("id")); |
| 986 |
|
|
| 987 |
|
$newSchema = new Schema(); |
| 988 |
|
$table = $newSchema->createTable("foo"); |
| 989 |
|
$table->addColumn("id", "integer", array("autoincrement" => true)); |
| 990 |
|
$table->setPrimaryKey(array("id")); |
| 991 |
|
$newSchema->createSequence("foo_id_seq"); |
| 992 |
|
|
| 993 |
|
$c = new Comparator(); |
| 994 |
|
$diff = $c->compare($oldSchema, $newSchema); |
| 995 |
|
|
| 996 |
|
self::assertCount(0, $diff->newSequences); |
| 997 |
|
} |
| 998 |
|
/** |
| 999 |
|
* You can get multiple drops for a FK when a table referenced by a foreign |
| 1000 |
|
* key is deleted, as this FK is referenced twice, once on the orphanedForeignKeys |