Skip to content

Commit

Permalink
avniproject/avni-media#179 | Fix duplicate index creation on media table
Browse files Browse the repository at this point in the history
  • Loading branch information
1t5j0y committed Nov 15, 2024
1 parent b848274 commit 26bfc6d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.avniproject.etl.repository.rowMappers;

import org.avniproject.etl.domain.metadata.Column;
import org.avniproject.etl.domain.metadata.ColumnMetadata;
import org.avniproject.etl.domain.metadata.IndexMetadata;
import org.avniproject.etl.domain.metadata.TableMetadata;
Expand All @@ -15,7 +16,7 @@ public static TableMetadata build() {
mediaTableMetadata.setName(mediaTable.name(null));
mediaTableMetadata.setType(TableMetadata.Type.Media);
mediaTableMetadata.addColumnMetadata(mediaTable.columns().stream().map(column -> new ColumnMetadata(column, null, null, null)).collect(Collectors.toList()));
mediaTableMetadata.addIndexMetadata(mediaTable.columns().stream().map(column -> column.isIndexed() ? new IndexMetadata(new ColumnMetadata(column)) : null).filter(Objects::nonNull).collect(Collectors.toList()));
mediaTable.columns().stream().filter(Column::isIndexed).forEach(column -> mediaTableMetadata.addIndexMetadata(column));
return mediaTableMetadata;
}
}

0 comments on commit 26bfc6d

Please sign in to comment.