Code Duplication    Length = 13-14 lines in 2 locations

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

@@ 338-351 (lines=14) @@
335
    /**
336
     * {@inheritdoc}
337
     */
338
    public function hasColumn($tableName, $columnName)
339
    {
340
        $sql = sprintf(
341
            "SELECT count(*)
342
            FROM information_schema.columns
343
            WHERE table_schema = '%s' AND table_name = '%s' AND column_name = '%s'",
344
            $this->getSchemaName(),
345
            $tableName,
346
            $columnName
347
        );
348
349
        $result = $this->fetchRow($sql);
350
351
        return $result['count'] > 0;
352
    }
353
354
    /**

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

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