| @@ 188-203 (lines=16) @@ | ||
| 185 | return 'CREATE UNIQUE INDEX index_name ON test (test, test2)'; |
|
| 186 | } |
|
| 187 | ||
| 188 | public function testGeneratesSequenceSqlCommands() |
|
| 189 | { |
|
| 190 | $sequence = new \Doctrine\DBAL\Schema\Sequence('myseq', 20, 1); |
|
| 191 | self::assertEquals( |
|
| 192 | 'CREATE SEQUENCE myseq INCREMENT BY 20 MINVALUE 1 START 1', |
|
| 193 | $this->_platform->getCreateSequenceSQL($sequence) |
|
| 194 | ); |
|
| 195 | self::assertEquals( |
|
| 196 | 'DROP SEQUENCE myseq CASCADE', |
|
| 197 | $this->_platform->getDropSequenceSQL('myseq') |
|
| 198 | ); |
|
| 199 | self::assertEquals( |
|
| 200 | "SELECT NEXTVAL('myseq')", |
|
| 201 | $this->_platform->getSequenceNextValSQL('myseq') |
|
| 202 | ); |
|
| 203 | } |
|
| 204 | ||
| 205 | public function testDoesNotPreferIdentityColumns() |
|
| 206 | { |
|
| @@ 26-45 (lines=20) @@ | ||
| 23 | self::assertFalse($this->_platform->prefersSequences()); |
|
| 24 | } |
|
| 25 | ||
| 26 | public function testGeneratesSequenceSqlCommands() |
|
| 27 | { |
|
| 28 | $sequence = new Sequence('myseq', 20, 1); |
|
| 29 | self::assertEquals( |
|
| 30 | 'CREATE SEQUENCE myseq START WITH 1 INCREMENT BY 20 MINVALUE 1', |
|
| 31 | $this->_platform->getCreateSequenceSQL($sequence) |
|
| 32 | ); |
|
| 33 | self::assertEquals( |
|
| 34 | 'ALTER SEQUENCE myseq INCREMENT BY 20', |
|
| 35 | $this->_platform->getAlterSequenceSQL($sequence) |
|
| 36 | ); |
|
| 37 | self::assertEquals( |
|
| 38 | 'DROP SEQUENCE myseq', |
|
| 39 | $this->_platform->getDropSequenceSQL('myseq') |
|
| 40 | ); |
|
| 41 | self::assertEquals( |
|
| 42 | "SELECT NEXT VALUE FOR myseq", |
|
| 43 | $this->_platform->getSequenceNextValSQL('myseq') |
|
| 44 | ); |
|
| 45 | } |
|
| 46 | ||
| 47 | ||
| 48 | public function testModifyLimitQuery() |
|