Code Duplication    Length = 9-9 lines in 2 locations

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

@@ 988-996 (lines=9) @@
985
     */
986
    protected function getIndexSqlDefinition(Index $index, $tableName)
987
    {
988
        if (is_string($index->getName())) {
989
            $indexName = $index->getName();
990
        } else {
991
            $columnNames = $index->getColumns();
992
            if (is_string($columnNames)) {
993
                $columnNames = [$columnNames];
994
            }
995
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
996
        }
997
        $def = sprintf(
998
            "CREATE %s INDEX %s ON %s (%s);",
999
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

@@ 1045-1053 (lines=9) @@
1042
     */
1043
    protected function getIndexSqlDefinition(Index $index, $tableName)
1044
    {
1045
        if (is_string($index->getName())) {
1046
            $indexName = $index->getName();
1047
        } else {
1048
            $columnNames = $index->getColumns();
1049
            if (is_string($columnNames)) {
1050
                $columnNames = [$columnNames];
1051
            }
1052
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1053
        }
1054
        $def = sprintf(
1055
            "CREATE %s INDEX %s ON %s (%s);",
1056
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),