Compare commits
2 Commits
9de792aa02
...
4e5b695c22
| Author | SHA1 | Date | |
|---|---|---|---|
| 4e5b695c22 | |||
| 9b43bdab99 |
@@ -128,7 +128,7 @@ function initDatabase() {
|
|||||||
)
|
)
|
||||||
`);
|
`);
|
||||||
|
|
||||||
// migrate: add OFA-specific columns if missing
|
// migrate: add OFA-specific columns if missing (covers existing DBs)
|
||||||
const healthMigrations = [
|
const healthMigrations = [
|
||||||
['test_type', 'TEXT'],
|
['test_type', 'TEXT'],
|
||||||
['ofa_result', 'TEXT'],
|
['ofa_result', 'TEXT'],
|
||||||
@@ -136,6 +136,9 @@ function initDatabase() {
|
|||||||
['performed_by', 'TEXT'],
|
['performed_by', 'TEXT'],
|
||||||
['expires_at', 'TEXT'],
|
['expires_at', 'TEXT'],
|
||||||
['document_url', 'TEXT'],
|
['document_url', 'TEXT'],
|
||||||
|
['result', 'TEXT'],
|
||||||
|
['vet_name', 'TEXT'],
|
||||||
|
['next_due', 'TEXT'],
|
||||||
];
|
];
|
||||||
for (const [col, def] of healthMigrations) {
|
for (const [col, def] of healthMigrations) {
|
||||||
try { db.exec(`ALTER TABLE health_records ADD COLUMN ${col} ${def}`); } catch (_) { /* already exists */ }
|
try { db.exec(`ALTER TABLE health_records ADD COLUMN ${col} ${def}`); } catch (_) { /* already exists */ }
|
||||||
|
|||||||
Reference in New Issue
Block a user