Files
ironclaw/migrations/V26__root_filesystem_entries.sql
firat.sertgoz b308603040 feat(reborn): add filesystem substrate (#2996)
* feat(reborn): add filesystem substrate

* fix(reborn): address filesystem review findings

* fix(reborn): address filesystem substrate review

* fix(reborn): align filesystem substrate semantics
2026-04-28 14:55:59 +03:00

16 lines
696 B
SQL

-- Reborn RootFilesystem database backend storage.
-- Stores canonical virtual-path file contents; directories are inferred from path prefixes.
CREATE TABLE IF NOT EXISTS root_filesystem_entries (
path TEXT PRIMARY KEY CHECK (path LIKE '/%'),
contents BYTEA NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
-- Index uses text_pattern_ops so prefix `LIKE '/path/%'` queries used by the
-- DB backend's child-entry scans can be served from the index. Equality
-- lookups already use the PRIMARY KEY's btree.
CREATE INDEX IF NOT EXISTS idx_root_filesystem_entries_path
ON root_filesystem_entries(path text_pattern_ops);