feat: privacy-respecting analytics

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-09 00:15:20 +00:00
co-authored by Claude Opus 4.6
parent 2170e9275c
commit e10c1dc8aa
6 changed files with 116 additions and 0 deletions
+9
View File
@@ -126,6 +126,15 @@ export function runMigrations() {
);
`)
sqlite.exec(`
CREATE TABLE IF NOT EXISTS analytics (
date TEXT NOT NULL,
metric TEXT NOT NULL,
value INTEGER NOT NULL DEFAULT 0
);
CREATE UNIQUE INDEX IF NOT EXISTS idx_analytics_date_metric ON analytics(date, metric);
`)
// Column migrations for existing databases
const migrations = [
"ALTER TABLE bots ADD COLUMN archetype TEXT NOT NULL DEFAULT 'standard'",