Code Duplication    Length = 14-15 lines in 3 locations

src/Phinx/Db/Adapter/MysqlAdapter.php 2 locations

@@ 380-394 (lines=15) @@
377
    /**
378
     * {@inheritdoc}
379
     */
380
    public function addColumn(Table $table, Column $column)
381
    {
382
        $sql = sprintf(
383
            'ALTER TABLE %s ADD %s %s',
384
            $this->quoteTableName($table->getName()),
385
            $this->quoteColumnName($column->getName()),
386
            $this->getColumnSqlDefinition($column)
387
        );
388
389
        if ($column->getAfter()) {
390
            $sql .= ' AFTER ' . $this->quoteColumnName($column->getAfter());
391
        }
392
393
        $this->execute($sql);
394
    }
395
396
    /**
397
     * {@inheritdoc}
@@ 434-447 (lines=14) @@
431
    /**
432
     * {@inheritdoc}
433
     */
434
    public function changeColumn($tableName, $columnName, Column $newColumn)
435
    {
436
        $after = $newColumn->getAfter() ? ' AFTER ' . $this->quoteColumnName($newColumn->getAfter()) : '';
437
        $this->execute(
438
            sprintf(
439
                'ALTER TABLE %s CHANGE %s %s %s%s',
440
                $this->quoteTableName($tableName),
441
                $this->quoteColumnName($columnName),
442
                $this->quoteColumnName($newColumn->getName()),
443
                $this->getColumnSqlDefinition($newColumn),
444
                $after
445
            )
446
        );
447
    }
448
449
    /**
450
     * {@inheritdoc}

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

@@ 390-404 (lines=15) @@
387
    /**
388
     * {@inheritdoc}
389
     */
390
    public function addColumn(Table $table, Column $column)
391
    {
392
        $sql = sprintf(
393
            'ALTER TABLE %s ADD %s %s;',
394
            $this->quoteTableName($table->getName()),
395
            $this->quoteColumnName($column->getName()),
396
            $this->getColumnSqlDefinition($column)
397
        );
398
399
        if ($column->getComment()) {
400
            $sql .= $this->getColumnCommentSqlDefinition($column, $table->getName());
401
        }
402
403
        $this->execute($sql);
404
    }
405
406
    /**
407
     * {@inheritdoc}