Code Duplication    Length = 16-16 lines in 2 locations

src/Phinx/Db/Adapter/SqlServerAdapter.php 1 location

@@ 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
    {

src/Phinx/Db/Adapter/OracleAdapter.php 1 location

@@ 436-451 (lines=16) @@
433
        );
434
    }
435
436
    protected function renameDefault($tableName, $columnName, $newColumnName)
437
    {
438
        $oldConstraintName = "DF_{$tableName}_{$columnName}";
439
        $newConstraintName = "DF_{$tableName}_{$newColumnName}";
440
        $sql = <<<SQL
441
IF (OBJECT_ID('$oldConstraintName', 'D') IS NOT NULL)
442
BEGIN
443
     EXECUTE sp_rename N'%s', N'%s', N'OBJECT'
444
END
445
SQL;
446
        $this->execute(sprintf(
447
            $sql,
448
            $oldConstraintName,
449
            $newConstraintName
450
        ));
451
    }
452
453
    /**
454
     * {@inheritdoc}