feat(topology): persist complete diagram semantics

This commit is contained in:
2026-07-09 21:53:00 +08:00
parent e7becba0b0
commit 0dbcd3086e
4 changed files with 139 additions and 44 deletions
@@ -0,0 +1,18 @@
-- Persist all presentation semantics required by the database-driven SVG.
ALTER TABLE topology.diagram_nodes
ADD COLUMN IF NOT EXISTS display_meta text,
ADD COLUMN IF NOT EXISTS display_hint text,
ADD COLUMN IF NOT EXISTS decorations jsonb NOT NULL DEFAULT '{}'::jsonb;
CREATE TABLE IF NOT EXISTS topology.diagram_node_members (
diagram_node_id uuid NOT NULL
REFERENCES topology.diagram_nodes(id) ON DELETE CASCADE,
component_id uuid NOT NULL
REFERENCES topology.components(id),
display_order integer NOT NULL DEFAULT 0,
PRIMARY KEY (diagram_node_id, component_id)
);
CREATE INDEX IF NOT EXISTS idx_diagram_node_members_component
ON topology.diagram_node_members(component_id);