1.2 KiB
1.2 KiB
name, description
| name | description |
|---|---|
| medassist-db-compat-check | Enforce backward-compatible database changes for MedAssist SQLite and Drizzle migrations, including equivalent requests phrased in German. |
Skill Instructions
Use this skill for any feature or fix that adds or reads persisted data.
Mandatory Sequence
For every new persisted field/column:
- Add the column in
backend/src/db/schema.tswithNOT NULL DEFAULT <value>. - Generate migration with Drizzle Kit.
- Add matching
ALTER TABLElogic inbackend/src/db/client.tsinsiderunAlterMigrations(). - Read values null-safe in routes/services (
?? defaultValue).
Hard Rules
- Never remove or rename existing columns.
- Never add non-null columns without defaults.
- Never read newly added fields without fallback.
- Never manually edit generated Drizzle SQL migrations.
Verification Checklist
- Schema update exists.
- Generated migration exists.
- Alter migration for existing DBs exists.
- Runtime reads are fallback-safe.
Response Format
Report these items explicitly:
- New/changed columns
- Added alter-migration statements
- Null-safe read locations
- Remaining migration risk (if any)