From 3bef7dea9e4ee51e9acd1c2227c54a3383bc2477 Mon Sep 17 00:00:00 2001 From: Brandon Li Date: Sun, 30 Aug 2026 16:16:06 -0500 Subject: [PATCH] Seed only NQ, GC and CL as enabled instruments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The other 17 symbols still seed, so they remain listed and can be switched on from the Instruments page — they just start disabled. Affects fresh installs only: the seed block runs only when the instruments table is empty, so existing databases keep their current selection. Co-Authored-By: Claude Opus 5 --- lib/db.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/db.ts b/lib/db.ts index d81f318..3fbfbef 100644 --- a/lib/db.ts +++ b/lib/db.ts @@ -199,11 +199,15 @@ export function setSetting(key: string, value: string): void { const SYMBOLS = ['NQ','MNQ','ES','MES','YM','MYM','RTY','M2K','GC','MGC','SI','CL','MCL','NG','ZB','ZN','ZF','6E','6J','6B']; +// Enabled on a fresh install. The rest still seed, so they can be switched on +// from the Instruments page, they just start off. +const DEFAULT_ENABLED = new Set(['NQ', 'GC', 'CL']); + // Seed instruments table if empty const instrCount = (db.prepare('SELECT COUNT(*) as count FROM instruments').get() as { count: number }).count; if (instrCount === 0) { - const ins = db.prepare('INSERT INTO instruments (symbol, enabled) VALUES (?, 1)'); - for (const s of SYMBOLS) ins.run(s); + const ins = db.prepare('INSERT INTO instruments (symbol, enabled) VALUES (?, ?)'); + for (const s of SYMBOLS) ins.run(s, DEFAULT_ENABLED.has(s) ? 1 : 0); } export interface InstrumentRow {