コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey)
 {
     $query = '';
     if ($foreignKey->hasOption('match')) {
         $query = ' MATCH ' . $this->getForeignKeyMatchClauseSQL($foreignKey->getOption('match'));
     }
     $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey);
     if ($foreignKey->hasOption('check_on_commit') && (bool) $foreignKey->getOption('check_on_commit')) {
         $query .= ' CHECK ON COMMIT';
     }
     if ($foreignKey->hasOption('clustered') && (bool) $foreignKey->getOption('clustered')) {
         $query .= ' CLUSTERED';
     }
     if ($foreignKey->hasOption('for_olap_workload') && (bool) $foreignKey->getOption('for_olap_workload')) {
         $query .= ' FOR OLAP WORKLOAD';
     }
     return $query;
 }
コード例 #2
0
 /**
  * {@inheritDoc}
  */
 public function getAdvancedForeignKeyOptionsSQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey)
 {
     $query = '';
     if ($foreignKey->hasOption('match')) {
         $query .= ' MATCH ' . $foreignKey->getOption('match');
     }
     $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey);
     if ($foreignKey->hasOption('deferrable') && $foreignKey->getOption('deferrable') !== false) {
         $query .= ' DEFERRABLE';
     } else {
         $query .= ' NOT DEFERRABLE';
     }
     if ($foreignKey->hasOption('feferred') && $foreignKey->getOption('feferred') !== false || $foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false) {
         $query .= ' INITIALLY DEFERRED';
     } else {
         $query .= ' INITIALLY IMMEDIATE';
     }
     return $query;
 }
コード例 #3
0
 /**
  * {@inheritDoc}
  */
 public function getAdvancedForeignKeyOptionsSQL(\Doctrine\DBAL\Schema\ForeignKeyConstraint $foreignKey)
 {
     $query = '';
     if ($foreignKey->hasOption('match')) {
         $query .= ' MATCH ' . $foreignKey->getOption('match');
     }
     $query .= parent::getAdvancedForeignKeyOptionsSQL($foreignKey);
     return $query;
 }
コード例 #4
0
 /**
  * {@inheritDoc}
  */
 public function getAdvancedForeignKeyOptionsSQL(ForeignKeyConstraint $foreignKey)
 {
     $query = parent::getAdvancedForeignKeyOptionsSQL($foreignKey);
     $query .= ($foreignKey->hasOption('deferrable') && $foreignKey->getOption('deferrable') !== false ? ' ' : ' NOT ') . 'DEFERRABLE';
     $query .= ' INITIALLY ' . ($foreignKey->hasOption('deferred') && $foreignKey->getOption('deferred') !== false ? 'DEFERRED' : 'IMMEDIATE');
     return $query;
 }