コード例 #1
0
ファイル: OraclePlatform.php プロジェクト: michaelnavarro/zc
 /**
  * Gets the SQL used to create a sequence that starts with a given value
  * and increments by the given allocation size.
  *
  * Need to specifiy minvalue, since start with is hidden in the system and MINVALUE <= START WITH.
  * Therefore we can use MINVALUE to be able to get a hint what START WITH was for later introspection
  * in {@see listSequences()}
  *
  * @param \Doctrine\DBAL\Schema\Sequence $sequence
  * @return string
  */
 public function getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence)
 {
     return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . ' START WITH ' . $sequence->getInitialValue() . ' MINVALUE ' . $sequence->getInitialValue() . ' INCREMENT BY ' . $sequence->getAllocationSize();
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  */
 public function getCreateSequenceSQL(Sequence $sequence)
 {
     return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) . ' INCREMENT BY ' . $sequence->getAllocationSize() . ' MINVALUE ' . $sequence->getInitialValue() . ' START ' . $sequence->getInitialValue() . $this->getSequenceCacheSQL($sequence);
 }
コード例 #3
0
 public function testReturnsSequenceSQL()
 {
     $sequence = new Sequence('test_seq', 1, 10);
     $this->assertEquals('CREATE SEQUENCE ' . $sequence->getQuotedName($this->_platform) . ' START WITH ' . $sequence->getInitialValue() . ' INCREMENT BY ' . $sequence->getAllocationSize() . ' MINVALUE ' . $sequence->getInitialValue(), $this->_platform->getCreateSequenceSQL($sequence));
     $this->assertEquals('ALTER SEQUENCE ' . $sequence->getQuotedName($this->_platform) . ' INCREMENT BY ' . $sequence->getAllocationSize(), $this->_platform->getAlterSequenceSQL($sequence));
     $this->assertEquals('DROP SEQUENCE ' . $sequence->getName(), $this->_platform->getDropSequenceSQL($sequence));
     $this->assertEquals('DROP SEQUENCE ' . $sequence->getName(), $this->_platform->getDropSequenceSQL($sequence->getName()));
 }
コード例 #4
0
ファイル: Comparator.php プロジェクト: kirkbauer2/kirkxc
 /**
  * @param \Doctrine\DBAL\Schema\Sequence $sequence1
  * @param \Doctrine\DBAL\Schema\Sequence $sequence2
  *
  * @return boolean
  */
 public function diffSequence(Sequence $sequence1, Sequence $sequence2)
 {
     if ($sequence1->getAllocationSize() != $sequence2->getAllocationSize()) {
         return true;
     }
     if ($sequence1->getInitialValue() != $sequence2->getInitialValue()) {
         return true;
     }
     return false;
 }
コード例 #5
0
ファイル: ExportVisitor.php プロジェクト: ming-hai/XoopsCore
 /**
  * Accept an sequence
  *
  * @param Sequence $sequence a sequence object
  * 
  * @return void
  */
 public function acceptSequence(Sequence $sequence)
 {
     $this->schemaArray['sequence'][$sequence->getName()] = array('name' => $sequence->getName(), 'allocationsize' => $sequence->getAllocationSize(), 'initialvalue' => $sequence->getInitialValue());
 }