Initial commit: AS4/411 directory and discovery service for Sankofa Marketplace
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
20
packages/storage/migrations/003_edges.sql
Normal file
20
packages/storage/migrations/003_edges.sql
Normal file
@@ -0,0 +1,20 @@
|
||||
-- Graph layer: edges with provenance and validity (see data-model.md).
|
||||
-- Optional: used when explicit graph and conflict resolution are needed.
|
||||
|
||||
CREATE TABLE IF NOT EXISTS edges (
|
||||
id TEXT PRIMARY KEY,
|
||||
from_type TEXT NOT NULL,
|
||||
from_id TEXT NOT NULL,
|
||||
to_type TEXT NOT NULL,
|
||||
to_id TEXT NOT NULL,
|
||||
relation TEXT NOT NULL,
|
||||
confidence REAL,
|
||||
source TEXT,
|
||||
valid_from TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
||||
valid_to TIMESTAMPTZ
|
||||
);
|
||||
|
||||
CREATE INDEX idx_edges_from ON edges(from_type, from_id);
|
||||
CREATE INDEX idx_edges_to ON edges(to_type, to_id);
|
||||
CREATE INDEX idx_edges_relation ON edges(relation);
|
||||
CREATE INDEX idx_edges_valid ON edges(valid_from, valid_to);
|
||||
Reference in New Issue
Block a user