mirror of
https://github.com/vran-dev/databasir.git
synced 2025-09-18 01:37:12 +08:00
fix: trigger diff failed
This commit is contained in:
@@ -35,14 +35,17 @@ public class JdbcIndexMetaProvider implements IndexMetaProvider {
|
||||
return indexMetas;
|
||||
}
|
||||
|
||||
Map<String, IndexMeta> pojoGroupByName = new HashMap<>();
|
||||
Map<String, IndexMeta> metaGroupByName = new HashMap<>();
|
||||
try {
|
||||
while (indexResults.next()) {
|
||||
Boolean nonUnique = indexResults.getBoolean("NON_UNIQUE");
|
||||
String indexName = indexResults.getString("INDEX_NAME");
|
||||
String columnName = indexResults.getString("COLUMN_NAME");
|
||||
if (pojoGroupByName.containsKey(indexName)) {
|
||||
pojoGroupByName.get(indexName).getColumnNames().add(columnName);
|
||||
if (indexName == null) {
|
||||
continue;
|
||||
}
|
||||
if (metaGroupByName.containsKey(indexName)) {
|
||||
metaGroupByName.get(indexName).getColumnNames().add(columnName);
|
||||
} else {
|
||||
List<String> columns = new ArrayList<>();
|
||||
columns.add(columnName);
|
||||
@@ -51,13 +54,13 @@ public class JdbcIndexMetaProvider implements IndexMetaProvider {
|
||||
.columnNames(columns)
|
||||
.isUniqueKey(Objects.equals(nonUnique, false))
|
||||
.build();
|
||||
pojoGroupByName.put(indexName, indexMeta);
|
||||
metaGroupByName.put(indexName, indexMeta);
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
indexResults.close();
|
||||
}
|
||||
return new ArrayList<>(pojoGroupByName.values());
|
||||
return new ArrayList<>(metaGroupByName.values());
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user