| @@ 858-872 (lines=15) @@ | ||
| 855 | /** |
|
| 856 | * @group DBAL-234 |
|
| 857 | */ |
|
| 858 | public function testAlterTableRenameIndex() |
|
| 859 | { |
|
| 860 | $tableDiff = new TableDiff('mytable'); |
|
| 861 | $tableDiff->fromTable = new Table('mytable'); |
|
| 862 | $tableDiff->fromTable->addColumn('id', 'integer'); |
|
| 863 | $tableDiff->fromTable->setPrimaryKey(array('id')); |
|
| 864 | $tableDiff->renamedIndexes = array( |
|
| 865 | 'idx_foo' => new Index('idx_bar', array('id')) |
|
| 866 | ); |
|
| 867 | ||
| 868 | self::assertSame( |
|
| 869 | $this->getAlterTableRenameIndexSQL(), |
|
| 870 | $this->_platform->getAlterTableSQL($tableDiff) |
|
| 871 | ); |
|
| 872 | } |
|
| 873 | ||
| 874 | /** |
|
| 875 | * @group DBAL-234 |
|
| @@ 1013-1027 (lines=15) @@ | ||
| 1010 | /** |
|
| 1011 | * @group DBAL-807 |
|
| 1012 | */ |
|
| 1013 | public function testAlterTableRenameIndexInSchema() |
|
| 1014 | { |
|
| 1015 | $tableDiff = new TableDiff('myschema.mytable'); |
|
| 1016 | $tableDiff->fromTable = new Table('myschema.mytable'); |
|
| 1017 | $tableDiff->fromTable->addColumn('id', 'integer'); |
|
| 1018 | $tableDiff->fromTable->setPrimaryKey(array('id')); |
|
| 1019 | $tableDiff->renamedIndexes = array( |
|
| 1020 | 'idx_foo' => new Index('idx_bar', array('id')) |
|
| 1021 | ); |
|
| 1022 | ||
| 1023 | self::assertSame( |
|
| 1024 | $this->getAlterTableRenameIndexInSchemaSQL(), |
|
| 1025 | $this->_platform->getAlterTableSQL($tableDiff) |
|
| 1026 | ); |
|
| 1027 | } |
|
| 1028 | ||
| 1029 | /** |
|
| 1030 | * @group DBAL-807 |
|