@@ 1457-1471 (lines=15) @@ | ||
1454 | * |
|
1455 | * @return string |
|
1456 | */ |
|
1457 | public function getDropConstraintSQL($constraint, $table) |
|
1458 | { |
|
1459 | if (! $constraint instanceof Constraint) { |
|
1460 | $constraint = new Identifier($constraint); |
|
1461 | } |
|
1462 | ||
1463 | if (! $table instanceof Table) { |
|
1464 | $table = new Identifier($table); |
|
1465 | } |
|
1466 | ||
1467 | $constraint = $constraint->getQuotedName($this); |
|
1468 | $table = $table->getQuotedName($this); |
|
1469 | ||
1470 | return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $constraint; |
|
1471 | } |
|
1472 | ||
1473 | /** |
|
1474 | * Returns the SQL to drop a foreign key. |
|
@@ 1481-1495 (lines=15) @@ | ||
1478 | * |
|
1479 | * @return string |
|
1480 | */ |
|
1481 | public function getDropForeignKeySQL($foreignKey, $table) |
|
1482 | { |
|
1483 | if (! $foreignKey instanceof ForeignKeyConstraint) { |
|
1484 | $foreignKey = new Identifier($foreignKey); |
|
1485 | } |
|
1486 | ||
1487 | if (! $table instanceof Table) { |
|
1488 | $table = new Identifier($table); |
|
1489 | } |
|
1490 | ||
1491 | $foreignKey = $foreignKey->getQuotedName($this); |
|
1492 | $table = $table->getQuotedName($this); |
|
1493 | ||
1494 | return 'ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey; |
|
1495 | } |
|
1496 | ||
1497 | /** |
|
1498 | * Returns the SQL statement(s) to create a table with the specified name, columns and constraints |
@@ 700-714 (lines=15) @@ | ||
697 | /** |
|
698 | * {@inheritDoc} |
|
699 | */ |
|
700 | public function getDropForeignKeySQL($foreignKey, $table) |
|
701 | { |
|
702 | if (! $foreignKey instanceof ForeignKeyConstraint) { |
|
703 | $foreignKey = new Identifier($foreignKey); |
|
704 | } |
|
705 | ||
706 | if (! $table instanceof Table) { |
|
707 | $table = new Identifier($table); |
|
708 | } |
|
709 | ||
710 | $foreignKey = $foreignKey->getQuotedName($this); |
|
711 | $table = $table->getQuotedName($this); |
|
712 | ||
713 | return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; |
|
714 | } |
|
715 | ||
716 | /** |
|
717 | * {@inheritdoc} |
@@ 191-205 (lines=15) @@ | ||
188 | /** |
|
189 | * {@inheritDoc} |
|
190 | */ |
|
191 | public function getDropForeignKeySQL($foreignKey, $table) |
|
192 | { |
|
193 | if (! $foreignKey instanceof ForeignKeyConstraint) { |
|
194 | $foreignKey = new Identifier($foreignKey); |
|
195 | } |
|
196 | ||
197 | if (! $table instanceof Table) { |
|
198 | $table = new Identifier($table); |
|
199 | } |
|
200 | ||
201 | $foreignKey = $foreignKey->getQuotedName($this); |
|
202 | $table = $table->getQuotedName($this); |
|
203 | ||
204 | return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; |
|
205 | } |
|
206 | ||
207 | /** |
|
208 | * {@inheritDoc} |