| @@ 848-862 (lines=15) @@ | ||
| 845 | /** |
|
| 846 | * @group DBAL-234 |
|
| 847 | */ |
|
| 848 | public function testAlterTableRenameIndex() |
|
| 849 | { |
|
| 850 | $tableDiff = new TableDiff('mytable'); |
|
| 851 | $tableDiff->fromTable = new Table('mytable'); |
|
| 852 | $tableDiff->fromTable->addColumn('id', 'integer'); |
|
| 853 | $tableDiff->fromTable->setPrimaryKey(array('id')); |
|
| 854 | $tableDiff->renamedIndexes = array( |
|
| 855 | 'idx_foo' => new Index('idx_bar', array('id')) |
|
| 856 | ); |
|
| 857 | ||
| 858 | self::assertSame( |
|
| 859 | $this->getAlterTableRenameIndexSQL(), |
|
| 860 | $this->_platform->getAlterTableSQL($tableDiff) |
|
| 861 | ); |
|
| 862 | } |
|
| 863 | ||
| 864 | /** |
|
| 865 | * @group DBAL-234 |
|
| @@ 1003-1017 (lines=15) @@ | ||
| 1000 | /** |
|
| 1001 | * @group DBAL-807 |
|
| 1002 | */ |
|
| 1003 | public function testAlterTableRenameIndexInSchema() |
|
| 1004 | { |
|
| 1005 | $tableDiff = new TableDiff('myschema.mytable'); |
|
| 1006 | $tableDiff->fromTable = new Table('myschema.mytable'); |
|
| 1007 | $tableDiff->fromTable->addColumn('id', 'integer'); |
|
| 1008 | $tableDiff->fromTable->setPrimaryKey(array('id')); |
|
| 1009 | $tableDiff->renamedIndexes = array( |
|
| 1010 | 'idx_foo' => new Index('idx_bar', array('id')) |
|
| 1011 | ); |
|
| 1012 | ||
| 1013 | self::assertSame( |
|
| 1014 | $this->getAlterTableRenameIndexInSchemaSQL(), |
|
| 1015 | $this->_platform->getAlterTableSQL($tableDiff) |
|
| 1016 | ); |
|
| 1017 | } |
|
| 1018 | ||
| 1019 | /** |
|
| 1020 | * @group DBAL-807 |
|