CREATE TABLE IF NOT EXISTS document_aliases (
    path TEXT PRIMARY KEY,
    document_id TEXT NOT NULL REFERENCES documents(id) ON DELETE CASCADE,
    created_at TEXT NOT NULL
);

CREATE INDEX IF NOT EXISTS idx_document_aliases_document
ON document_aliases(document_id);
