Example #1
0
 /**
  * {@inheritDoc}
  */
 public function dropConstraintSql(Table $table)
 {
     $sqlPattern = 'ALTER TABLE %s DROP CONSTRAINT %s;';
     $sql = [];
     foreach ($table->constraints() as $name) {
         $constraint = $table->constraint($name);
         if ($constraint['type'] === Table::CONSTRAINT_FOREIGN) {
             $tableName = $this->_driver->quoteIdentifier($table->name());
             $constraintName = $this->_driver->quoteIdentifier($name);
             $sql[] = sprintf($sqlPattern, $tableName, $constraintName);
         }
     }
     return $sql;
 }