Code Duplication    Length = 13-14 lines in 2 locations

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

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

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

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