Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 1064-1069 (lines=6) @@
1061
    {
1062
        $parts = $this->getSchemaName($tableName);
1063
1064
        if (is_string($index->getName())) {
1065
            $indexName = $index->getName();
1066
        } else {
1067
            $columnNames = $index->getColumns();
1068
            $indexName = sprintf('%s_%s', $parts['table'], implode('_', $columnNames));
1069
        }
1070
        $def = sprintf(
1071
            "CREATE %s INDEX %s ON %s (%s);",
1072
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),

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

@@ 1082-1087 (lines=6) @@
1079
     */
1080
    protected function getIndexSqlDefinition(Index $index, $tableName)
1081
    {
1082
        if (is_string($index->getName())) {
1083
            $indexName = $index->getName();
1084
        } else {
1085
            $columnNames = $index->getColumns();
1086
            $indexName = sprintf('%s_%s', $tableName, implode('_', $columnNames));
1087
        }
1088
        $def = sprintf(
1089
            "CREATE %s INDEX %s ON %s (%s);",
1090
            ($index->getType() === Index::UNIQUE ? 'UNIQUE' : ''),