[agent-pipeline] pipe-20260328055039-5mki round-1
This commit is contained in:
@@ -32,10 +32,10 @@ public class TableManagementService extends BaseService {
|
||||
|
||||
public List<Map<String, Object>> getTableList() {
|
||||
List<Map<String, Object>> tables = sqlSession.selectList(NS + "getTableList");
|
||||
// columnCount BigInt → Integer 변환
|
||||
// column_count BigInt → Integer 변환
|
||||
for (Map<String, Object> t : tables) {
|
||||
Object cnt = t.get("columnCount");
|
||||
if (cnt instanceof Number) t.put("columnCount", ((Number) cnt).intValue());
|
||||
Object cnt = t.get("column_count");
|
||||
if (cnt instanceof Number) t.put("column_count", ((Number) cnt).intValue());
|
||||
}
|
||||
return tables;
|
||||
}
|
||||
@@ -234,7 +234,7 @@ public class TableManagementService extends BaseService {
|
||||
Map<String, Object> primaryKey = new HashMap<>();
|
||||
if (!pkResult.isEmpty()) {
|
||||
Map<String, Object> pk = pkResult.get(0);
|
||||
primaryKey.put("name", pk.get("constraintName"));
|
||||
primaryKey.put("name", pk.get("constraint_name"));
|
||||
primaryKey.put("columns", parseColumnArray(pk.get("columns")));
|
||||
} else {
|
||||
primaryKey.put("name", "");
|
||||
@@ -244,9 +244,9 @@ public class TableManagementService extends BaseService {
|
||||
List<Map<String, Object>> indexResult = sqlSession.selectList(NS + "getTableIndexList", params);
|
||||
List<Map<String, Object>> indexes = indexResult.stream().map(row -> {
|
||||
Map<String, Object> idx = new HashMap<>();
|
||||
idx.put("name", row.get("indexName"));
|
||||
idx.put("name", row.get("index_name"));
|
||||
idx.put("columns", parseColumnArray(row.get("columns")));
|
||||
idx.put("isUnique", row.get("isUnique"));
|
||||
idx.put("isUnique", row.get("is_unique"));
|
||||
return idx;
|
||||
}).collect(Collectors.toList());
|
||||
|
||||
@@ -264,7 +264,7 @@ public class TableManagementService extends BaseService {
|
||||
params.put("tableName", safeTable);
|
||||
List<Map<String, Object>> existingPk = sqlSession.selectList(NS + "getTablePrimaryKeyList", params);
|
||||
if (!existingPk.isEmpty()) {
|
||||
String constraintName = (String) existingPk.get(0).get("constraintName");
|
||||
String constraintName = (String) existingPk.get(0).get("constraint_name");
|
||||
jdbcTemplate.execute(
|
||||
String.format("ALTER TABLE \"public\".\"%s\" DROP CONSTRAINT \"%s\"",
|
||||
safeTable, sanitize(constraintName)));
|
||||
@@ -343,7 +343,7 @@ public class TableManagementService extends BaseService {
|
||||
|
||||
List<String> violations = new ArrayList<>();
|
||||
for (Map<String, Object> col : notNullCols) {
|
||||
String colName = (String) col.get("columnName");
|
||||
String colName = (String) col.get("column_name");
|
||||
Object val = data.get(colName);
|
||||
if (val == null || val.toString().isBlank()) {
|
||||
violations.add(colName);
|
||||
@@ -365,7 +365,7 @@ public class TableManagementService extends BaseService {
|
||||
List<String> violations = new ArrayList<>();
|
||||
|
||||
for (Map<String, Object> col : uniqueCols) {
|
||||
String colName = (String) col.get("columnName");
|
||||
String colName = (String) col.get("column_name");
|
||||
Object val = data.get(colName);
|
||||
if (val == null) continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user