refactor: rename memory_entity→knowledge_node, knowledge graph edge→knowledge_edge
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:
2026-09-15 15:22:41 +09:00
parent b514c43d6b
commit 7d49a2aaef
36 changed files with 263 additions and 283 deletions
@@ -47,7 +47,7 @@ CREATE TABLE IF NOT EXISTS community_member_map (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
project_id VARCHAR(255) NOT NULL,
community_id UUID NOT NULL REFERENCES memory_community(id) ON DELETE CASCADE,
entity_id UUID NOT NULL REFERENCES memory_entity(id) ON DELETE CASCADE,
entity_id UUID NOT NULL REFERENCES knowledge_node(id) ON DELETE CASCADE,
label_propagation_run_id UUID REFERENCES label_propagation_run(id) ON DELETE SET NULL,
-- Label strength (0-1, higher = stronger membership)