| @@ 773-782 (lines=10) @@ | ||
| 770 | /** |
|
| 771 | * @group DBAL-2508 |
|
| 772 | */ |
|
| 773 | public function testKeepsIndexOptionsOnRenamingUniqueIndex() : void |
|
| 774 | { |
|
| 775 | $table = new Table('foo'); |
|
| 776 | $table->addColumn('id', 'integer'); |
|
| 777 | $table->addUniqueIndex(['id'], 'idx_bar', ['where' => '1 = 1']); |
|
| 778 | ||
| 779 | $table->renameIndex('idx_bar', 'idx_baz'); |
|
| 780 | ||
| 781 | self::assertSame(['where' => '1 = 1'], $table->getIndex('idx_baz')->getOptions()); |
|
| 782 | } |
|
| 783 | ||
| 784 | /** |
|
| 785 | * @group DBAL-234 |
|
| @@ 801-812 (lines=12) @@ | ||
| 798 | /** |
|
| 799 | * @group DBAL-234 |
|
| 800 | */ |
|
| 801 | public function testThrowsExceptionOnRenamingToAlreadyExistingIndex() : void |
|
| 802 | { |
|
| 803 | $table = new Table('test'); |
|
| 804 | $table->addColumn('id', 'integer'); |
|
| 805 | $table->addColumn('foo', 'integer'); |
|
| 806 | $table->addIndex(['id'], 'idx_id'); |
|
| 807 | $table->addIndex(['foo'], 'idx_foo'); |
|
| 808 | ||
| 809 | $this->expectException(SchemaException::class); |
|
| 810 | ||
| 811 | $table->renameIndex('idx_id', 'idx_foo'); |
|
| 812 | } |
|
| 813 | ||
| 814 | /** |
|
| 815 | * @dataProvider getNormalizesAssetNames |
|