Code Duplication    Length = 13-14 lines in 2 locations

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

@@ 359-372 (lines=14) @@
356
    /**
357
     * {@inheritdoc}
358
     */
359
    public function hasColumn($tableName, $columnName)
360
    {
361
        $sql = sprintf(
362
            "SELECT count(*)
363
            FROM information_schema.columns
364
            WHERE table_schema = '%s' AND table_name = '%s' AND column_name = '%s'",
365
            $this->getSchemaName(),
366
            $tableName,
367
            $columnName
368
        );
369
370
        $result = $this->fetchRow($sql);
371
372
        return $result['count'] > 0;
373
    }
374
375
    /**

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}