示例#1
0
 /**
  * Adds condition for partial index.
  *
  * @param \Doctrine\DBAL\Schema\Index $index
  *
  * @return string
  */
 protected function getPartialIndexSQL(Index $index)
 {
     if ($this->supportsPartialIndexes() && $index->hasOption('where')) {
         return ' WHERE ' . $index->getOption('where');
     }
     return '';
 }
示例#2
0
 /**
  * Return whether the two indexes have the same partial index
  * @param \Doctrine\DBAL\Schema\Index $other
  *
  * @return boolean
  */
 private function samePartialIndex(Index $other)
 {
     if ($this->hasOption('where') && $other->hasOption('where') && $this->getOption('where') == $other->getOption('where')) {
         return true;
     }
     if (!$this->hasOption('where') && !$other->hasOption('where')) {
         return true;
     }
     return false;
 }