Skip to main content

MOUNT_SCHEMA

Constant MOUNT_SCHEMA 

Source
pub const MOUNT_SCHEMA: &str = r#"
-- ─────────────────────────────────────────────
-- Mounts (RFC-025) — path aliases
-- ─────────────────────────────────────────────
CREATE TABLE IF NOT EXISTS mounts (
    id                     TEXT PRIMARY KEY,
    name                   TEXT NOT NULL UNIQUE,
    paths                  TEXT NOT NULL,            -- JSON array of path strings
    auto_description       TEXT NOT NULL DEFAULT '',
    auto_meta              TEXT NOT NULL DEFAULT '{}', -- JSON MountMeta
    source                 TEXT NOT NULL DEFAULT 'manual',
    last_marker_snapshot   TEXT NOT NULL DEFAULT '{}', -- JSON {path_str: rfc3339_or_secs}
    enrichment_pending     INTEGER NOT NULL DEFAULT 0,
    last_enriched_at       TEXT,
    created_at             TEXT NOT NULL,
    updated_at             TEXT NOT NULL,
    last_active_at         TEXT NOT NULL
);

CREATE INDEX IF NOT EXISTS idx_mounts_name ON mounts(name);

-- ─────────────────────────────────────────────
-- Mount dismissals (RFC-025 Phase 5) — tombstones for deleted
-- AutoPromoted Mounts, so the scanner does not re-create them.
-- ─────────────────────────────────────────────
CREATE TABLE IF NOT EXISTS mount_dismissals (
    root_path TEXT PRIMARY KEY
);
"#;
Expand description

Schema DDL for the mounts table.