| @@ 429-444 (lines=16) @@ | ||
| 426 | ); |
|
| 427 | } |
|
| 428 | ||
| 429 | protected function renameDefault($tableName, $columnName, $newColumnName) |
|
| 430 | { |
|
| 431 | $oldConstraintName = "DF_{$tableName}_{$columnName}"; |
|
| 432 | $newConstraintName = "DF_{$tableName}_{$newColumnName}"; |
|
| 433 | $sql = <<<SQL |
|
| 434 | IF (OBJECT_ID('$oldConstraintName', 'D') IS NOT NULL) |
|
| 435 | BEGIN |
|
| 436 | EXECUTE sp_rename N'%s', N'%s', N'OBJECT' |
|
| 437 | END |
|
| 438 | SQL; |
|
| 439 | $this->execute(sprintf( |
|
| 440 | $sql, |
|
| 441 | $oldConstraintName, |
|
| 442 | $newConstraintName |
|
| 443 | )); |
|
| 444 | } |
|
| 445 | ||
| 446 | /** |
|
| 447 | * {@inheritdoc} |
|
| @@ 459-474 (lines=16) @@ | ||
| 456 | ); |
|
| 457 | } |
|
| 458 | ||
| 459 | protected function renameDefault($tableName, $columnName, $newColumnName) |
|
| 460 | { |
|
| 461 | $oldConstraintName = "DF_{$tableName}_{$columnName}"; |
|
| 462 | $newConstraintName = "DF_{$tableName}_{$newColumnName}"; |
|
| 463 | $sql = <<<SQL |
|
| 464 | IF (OBJECT_ID('$oldConstraintName', 'D') IS NOT NULL) |
|
| 465 | BEGIN |
|
| 466 | EXECUTE sp_rename N'%s', N'%s', N'OBJECT' |
|
| 467 | END |
|
| 468 | SQL; |
|
| 469 | $this->execute(sprintf( |
|
| 470 | $sql, |
|
| 471 | $oldConstraintName, |
|
| 472 | $newConstraintName |
|
| 473 | )); |
|
| 474 | } |
|
| 475 | ||
| 476 | public function changeDefault($tableName, Column $newColumn) |
|
| 477 | { |
|