Roadmap 2,3,4

This commit is contained in:
2026-03-11 23:48:35 -05:00
parent 17b008a674
commit 13185a5281
9 changed files with 575 additions and 79 deletions

View File

@@ -157,6 +157,18 @@ function initDatabase() {
)
`);
const geneticMigrations = [
['test_provider', 'TEXT'],
['marker', "TEXT NOT NULL DEFAULT 'unknown'"],
['result', "TEXT NOT NULL DEFAULT 'not_tested'"],
['test_date', 'TEXT'],
['document_url', 'TEXT'],
['notes', 'TEXT']
];
for (const [col, def] of geneticMigrations) {
try { db.exec(`ALTER TABLE genetic_tests ADD COLUMN ${col} ${def}`); } catch (_) {}
}
// ── Cancer History ────────────────────────────────────────────────────────
db.exec(`
CREATE TABLE IF NOT EXISTS cancer_history (
@@ -173,6 +185,17 @@ function initDatabase() {
)
`);
const cancerMigrations = [
['cancer_type', 'TEXT'],
['age_at_diagnosis', 'TEXT'],
['age_at_death', 'TEXT'],
['cause_of_death', 'TEXT'],
['notes', 'TEXT']
];
for (const [col, def] of cancerMigrations) {
try { db.exec(`ALTER TABLE cancer_history ADD COLUMN ${col} ${def}`); } catch (_) {}
}
// ── Settings ──────────────────────────────────────────────────────────────
db.exec(`
CREATE TABLE IF NOT EXISTS settings (