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

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