A deployable markdown editor that connects with your self hosted files and lets you edit in a beautiful interface
at main 23 lines 852 B view raw
1-- Cache statistics table 2CREATE TABLE IF NOT EXISTS cache_stats ( 3 id INTEGER PRIMARY KEY AUTOINCREMENT, 4 cache_key TEXT NOT NULL, 5 cache_type TEXT NOT NULL, -- 'file_tree' 6 event_type TEXT NOT NULL, -- 'hit', 'miss', 'invalidate' 7 user_id INTEGER, 8 response_time_ms INTEGER, 9 created_at DATETIME DEFAULT CURRENT_TIMESTAMP, 10 FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE SET NULL 11); 12 13-- Index for efficient queries 14CREATE INDEX IF NOT EXISTS idx_cache_stats_created_at ON cache_stats(created_at); 15CREATE INDEX IF NOT EXISTS idx_cache_stats_type_event ON cache_stats(cache_type, event_type); 16 17-- Auto-cleanup trigger: delete logs older than 7 days 18CREATE TRIGGER IF NOT EXISTS cleanup_old_cache_stats 19AFTER INSERT ON cache_stats 20BEGIN 21 DELETE FROM cache_stats 22 WHERE created_at < datetime('now', '-7 days'); 23END;