refactor: rename memory_entity→knowledge_node, knowledge graph edge→knowledge_edge
CI / CI (pull_request) Failing after 11m15s
CI / CI (pull_request) Failing after 11m15s
Resolves table name collision between: - memory_edge (provenance DAG: child_sha/parent_sha) — KEPT - knowledge_edge (knowledge graph: source_id/target_id) — NEW NAME Changes: - memory_entity → knowledge_node (all .rs + migrations 003-009) - knowledge graph memory_edge → knowledge_edge - memory_entity_version → knowledge_node_version - memory_edge_version → knowledge_edge_version - Added knowledge_node + knowledge_edge to init_schema() - Converted versioning.rs from sqlx::query_as! to runtime queries (avoids stale sqlx offline cache dependency) - Fixed UUID cast: $1::UUID for String→UUID column binds - Fixed column names: source_entity_id→source_id, target_entity_id→target_id Production DB: knowledge_node + knowledge_edge tables created, memory_entity VIEW points to knowledge_node for backward compat.
This commit is contained in:
@@ -108,7 +108,7 @@ impl FacetedSearch {
|
||||
// Get entity types
|
||||
let entity_types = sqlx::query_as::<_, (String, i64)>(
|
||||
"SELECT entity_type, COUNT(*) as cnt
|
||||
FROM memory_entity
|
||||
FROM knowledge_node
|
||||
WHERE deleted_at IS NULL
|
||||
GROUP BY entity_type
|
||||
ORDER BY cnt DESC
|
||||
@@ -128,7 +128,7 @@ impl FacetedSearch {
|
||||
|
||||
// Get total count
|
||||
let total_count: (i64,) = sqlx::query_as(
|
||||
"SELECT COUNT(*) FROM memory_entity WHERE deleted_at IS NULL"
|
||||
"SELECT COUNT(*) FROM knowledge_node WHERE deleted_at IS NULL"
|
||||
)
|
||||
.fetch_one(&self.pool)
|
||||
.await
|
||||
@@ -212,7 +212,7 @@ impl FacetedSearch {
|
||||
// Get relation types
|
||||
let relation_types = sqlx::query_as::<_, (String, i64)>(
|
||||
"SELECT relation_type, COUNT(*) as cnt
|
||||
FROM memory_edge
|
||||
FROM knowledge_edge
|
||||
WHERE fact_invalid_at IS NULL AND deleted_at IS NULL
|
||||
GROUP BY relation_type
|
||||
ORDER BY cnt DESC
|
||||
@@ -232,7 +232,7 @@ impl FacetedSearch {
|
||||
|
||||
// Get total count
|
||||
let total_count: (i64,) = sqlx::query_as(
|
||||
"SELECT COUNT(*) FROM memory_edge WHERE fact_invalid_at IS NULL AND deleted_at IS NULL"
|
||||
"SELECT COUNT(*) FROM knowledge_edge WHERE fact_invalid_at IS NULL AND deleted_at IS NULL"
|
||||
)
|
||||
.fetch_one(&self.pool)
|
||||
.await
|
||||
|
||||
Reference in New Issue
Block a user