Code Duplication    Length = 14-15 lines in 3 locations

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

@@ 394-408 (lines=15) @@
391
    /**
392
     * {@inheritdoc}
393
     */
394
    public function addColumn(Table $table, Column $column)
395
    {
396
        $sql = sprintf(
397
            'ALTER TABLE %s ADD %s %s',
398
            $this->quoteTableName($table->getName()),
399
            $this->quoteColumnName($column->getName()),
400
            $this->getColumnSqlDefinition($column)
401
        );
402
403
        if ($column->getAfter()) {
404
            $sql .= ' AFTER ' . $this->quoteColumnName($column->getAfter());
405
        }
406
407
        $this->execute($sql);
408
    }
409
410
    /**
411
     * {@inheritdoc}
@@ 448-461 (lines=14) @@
445
    /**
446
     * {@inheritdoc}
447
     */
448
    public function changeColumn($tableName, $columnName, Column $newColumn)
449
    {
450
        $after = $newColumn->getAfter() ? ' AFTER ' . $this->quoteColumnName($newColumn->getAfter()) : '';
451
        $this->execute(
452
            sprintf(
453
                'ALTER TABLE %s CHANGE %s %s %s%s',
454
                $this->quoteTableName($tableName),
455
                $this->quoteColumnName($columnName),
456
                $this->quoteColumnName($newColumn->getName()),
457
                $this->getColumnSqlDefinition($newColumn),
458
                $after
459
            )
460
        );
461
    }
462
463
    /**
464
     * {@inheritdoc}

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

@@ 364-378 (lines=15) @@
361
    /**
362
     * {@inheritdoc}
363
     */
364
    public function addColumn(Table $table, Column $column)
365
    {
366
        $sql = sprintf(
367
            'ALTER TABLE %s ADD %s %s;',
368
            $this->quoteTableName($table->getName()),
369
            $this->quoteColumnName($column->getName()),
370
            $this->getColumnSqlDefinition($column)
371
        );
372
373
        if ($column->getComment()) {
374
            $sql .= $this->getColumnCommentSqlDefinition($column, $table->getName());
375
        }
376
377
        $this->execute($sql);
378
    }
379
380
    /**
381
     * {@inheritdoc}