Code Duplication    Length = 12-21 lines in 2 locations

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

@@ 315-326 (lines=12) @@
312
        $this->execute($sql);
313
    }
314
315
    public function getColumnComment($tableName, $columnName)
316
    {
317
        $sql = sprintf("select COMMENTS from ALL_COL_COMMENTS WHERE COLUMN_NAME = '%s' and TABLE_NAME = '%s'",
318
            $columnName, $tableName);
319
        $row = $this->fetchRow($sql);
320
321
        if ($row['COMMENTS'] != 'NULL') {
322
            return $row['COMMENTS'];
323
        }
324
325
        return false;
326
    }
327
328
    /**
329
     * {@inheritdoc}

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

@@ 335-355 (lines=21) @@
332
        $this->execute($sql);
333
    }
334
335
    public function getColumnComment($tableName, $columnName)
336
    {
337
        $sql = sprintf("SELECT cast(extended_properties.[value] as nvarchar(4000)) comment
338
  FROM sys.schemas
339
 INNER JOIN sys.tables
340
    ON schemas.schema_id = tables.schema_id
341
 INNER JOIN sys.columns
342
    ON tables.object_id = columns.object_id
343
 INNER JOIN sys.extended_properties
344
    ON tables.object_id = extended_properties.major_id
345
   AND columns.column_id = extended_properties.minor_id
346
   AND extended_properties.name = 'MS_Description'
347
   WHERE schemas.[name] = '%s' AND tables.[name] = '%s' AND columns.[name] = '%s'", $this->schema, $tableName, $columnName);
348
        $row = $this->fetchRow($sql);
349
350
        if ($row) {
351
            return $row['comment'];
352
        }
353
354
        return false;
355
    }
356
357
    /**
358
     * {@inheritdoc}