fix: Remove old record_type CHECK constraint from health_records (Migration 003) #40
Reference in New Issue
Block a user
Delete Branch "fix/health-record-type-constraint"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The live
breedr.dbwas originally created with a restrictiveCHECKconstraint onhealth_records.record_type:This blocks newer record types like
ofa_clearancefrom being inserted, producing the error:The
init.jswas already updated to not include this constraint, but SQLite does not modify existing tables on restart — so the constraint persists in existing databases.Fix
Added Migration 003 to
migrations.jswhich:sqlite_masterhealth_recordsdataThe migration is idempotent and skips safely if the constraint is already absent (fresh installs).
Testing
ofa_clearancerecords can be inserted