Code Duplication    Length = 13-14 lines in 2 locations

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

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

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

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