Code Duplication    Length = 13-14 lines in 2 locations

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

@@ 412-424 (lines=13) @@
409
    /**
410
     * {@inheritdoc}
411
     */
412
    public function hasColumn($tableName, $columnName)
413
    {
414
        $sql = sprintf(
415
            "SELECT count(*) as [count]
416
             FROM information_schema.columns
417
             WHERE table_name = '%s' AND column_name = '%s'",
418
            $tableName,
419
            $columnName
420
        );
421
        $result = $this->fetchRow($sql);
422
423
        return $result['count'] > 0;
424
    }
425
426
    /**
427
     * {@inheritdoc}

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

@@ 379-392 (lines=14) @@
376
    /**
377
     * {@inheritdoc}
378
     */
379
    public function hasColumn($tableName, $columnName)
380
    {
381
        $sql = sprintf(
382
            "SELECT count(*)
383
            FROM information_schema.columns
384
            WHERE table_schema = '%s' AND table_name = '%s' AND column_name = '%s'",
385
            $this->getSchemaName(),
386
            $tableName,
387
            $columnName
388
        );
389
390
        $result = $this->fetchRow($sql);
391
392
        return $result['count'] > 0;
393
    }
394
395
    /**