1.3 KiB
1.3 KiB
Migration — 2026-03-28 — add user metadata fields
Purpose
Add user-specific metadata fields to support CopyMeThat import:
made— Boolean flag for "I've cooked this"rating— 1-5 star ratingnotes— General recipe notes/comments
Schema changes
ALTER TABLE recipes ADD COLUMN made INTEGER DEFAULT 0; -- SQLite boolean as 0/1
ALTER TABLE recipes ADD COLUMN rating INTEGER; -- 1-5 or NULL
ALTER TABLE recipes ADD COLUMN notes TEXT; -- Freeform text
Field specifications
- made: INTEGER (0 = false, 1 = true), NOT NULL, default 0
- rating: INTEGER (1-5), NULL allowed (no rating yet)
- notes: TEXT, NULL allowed (empty = no notes)
Runtime behavior
- New DBs:
schema.sqlwill be updated to include these fields - Existing DBs: Runtime migration helper will add columns if missing
Updated paths
src/backend/db/schema.sqlsrc/backend/db/schemaMigrations.tssrc/backend/types/recipe.tssrc/backend/repositories/RecipeRepository.tssrc/frontend/types/recipe.ts
Validation rules
made: Must be 0 or 1rating: If present, must be 1-5notes: Max length 10,000 characters (reasonable limit)
Operational note
Run: npm run migrate (idempotent, safe for existing DBs)
Migration date: 2026-03-28
Reason: CopyMeThat import feature support