Roadmap 2,3,4
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user