Skip to content

Instantly share code, notes, and snippets.

@deeky666
Created December 23, 2013 22:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deeky666/6c4e47a275b1c9e7c068 to your computer and use it in GitHub Desktop.
Save deeky666/6c4e47a275b1c9e7c068 to your computer and use it in GitHub Desktop.
Doctrine DBAL Sequence comparison issues with CACHE option
<?php
$comparator = new Comparator();
// Oracle
$platform = new OraclePlatform();
$sm = new OracleSchemaManager($conn, $platform);
$sequence = new Sequence('foo', 1, 1, null); // cache size null
$sm->createSequence($sequence); // CREATE SEQUENCE foo START WITH 1 MINVALUE 1 INCREMENT BY 1
$sequences = $sm->listSequences();
$introspectedSequence = $sequences['foo'];
$sequence->getCacheSize(); // cache size 20 (default value on Oracle)
$comparator->diffSequence($sequence, $introspectedSequence); // returns true (changed)
$platform->getAlterSequenceSQL($introspectedSequence); // expected to return '' but returns ALTER SEQUENCE INCREMENT BY 1 CACHE 20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment