Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1215-1220 (lines=6) @@
1212
    {
1213
        $parts = $this->getSchemaName($tableName);
1214
1215
        if (is_string($index->getName())) {
1216
            $indexName = $index->getName();
1217
        } else {
1218
            $columnNames = $index->getColumns();
1219
            $indexName = sprintf('%s_%s', $parts['table'], implode('_', $columnNames));
1220
        }
1221
1222
        return sprintf(
1223
            'CREATE %s INDEX %s ON %s (%s);',

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

@@ 1238-1243 (lines=6) @@
1235
     */
1236
    protected function getIndexSqlDefinition(Index $index, $tableName)
1237
    {
1238
        if (is_string($index->getName())) {
1239
            $indexName = $index->getName();
1240
        } else {
1241
            $columnNames = $index->getColumns();
1242
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1243
        }
1244
1245
        return sprintf(
1246
            'CREATE %s INDEX %s ON %s (%s);',