diff --git a/FlySpring/edgechain-app/src/main/java/com/edgechain/lib/index/repositories/PostgresClientMetadataRepository.java b/FlySpring/edgechain-app/src/main/java/com/edgechain/lib/index/repositories/PostgresClientMetadataRepository.java index 4c64cf5c2..0875402b9 100644 --- a/FlySpring/edgechain-app/src/main/java/com/edgechain/lib/index/repositories/PostgresClientMetadataRepository.java +++ b/FlySpring/edgechain-app/src/main/java/com/edgechain/lib/index/repositories/PostgresClientMetadataRepository.java @@ -46,7 +46,8 @@ public List batchInsertMetadata(String metadataTableName, List m UUID metadataId = jdbcTemplate.queryForObject( String.format( - "INSERT INTO %s (metadata_id, metadata) VALUES ('%s', '%s') RETURNING metadata_id;", + "INSERT INTO %s (metadata_id, metadata) VALUES ('%s', '%s') RETURNING" + + " metadata_id;", metadataTableName, UuidCreator.getTimeOrderedEpoch(), metadataList.get(i)), UUID.class); diff --git a/FlySpring/edgechain-app/src/main/java/com/edgechain/lib/index/repositories/PostgresClientRepository.java b/FlySpring/edgechain-app/src/main/java/com/edgechain/lib/index/repositories/PostgresClientRepository.java index 4793e4206..6cdcd435a 100644 --- a/FlySpring/edgechain-app/src/main/java/com/edgechain/lib/index/repositories/PostgresClientRepository.java +++ b/FlySpring/edgechain-app/src/main/java/com/edgechain/lib/index/repositories/PostgresClientRepository.java @@ -95,9 +95,9 @@ public List batchUpsertEmbeddings( UUID id = jdbcTemplate.queryForObject( String.format( - "INSERT INTO %s (id, raw_text, embedding, timestamp, namespace, filename) VALUES" - + " ('%s', '%s', '%s', '%s', '%s', '%s') ON CONFLICT (raw_text) DO UPDATE" - + " SET embedding = EXCLUDED.embedding RETURNING id;", + "INSERT INTO %s (id, raw_text, embedding, timestamp, namespace, filename)" + + " VALUES ('%s', '%s', '%s', '%s', '%s', '%s') ON CONFLICT (raw_text) DO" + + " UPDATE SET embedding = EXCLUDED.embedding RETURNING id;", tableName, UuidCreator.getTimeOrderedEpoch(), wordEmbeddings.getId(),