From 3dda308f309a8b60aa867af28db1f42ce08419ee Mon Sep 17 00:00:00 2001 From: dev_agent Date: Sun, 11 Oct 2026 11:52:51 -0400 Subject: [PATCH] Document the pre-deploy duplicate position check for migration 0018 (Maestro 75bb8cc1) Co-Authored-By: Claude Opus 5.5 --- docs/ARCHITECTURE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index b32ccc4..a385f4a 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -121,6 +121,16 @@ Columns ending in `_ct` hold AES-256-GCM ciphertext (via `secretbox`). `recipes` holds a fetched recipe page; `dinners` holds the household's meal record and its lifecycle, optionally linked to a recipe and a photo. +Migration `0018_recipe_item_position_unique` makes position unique per +recipe and fails, so the service refuses to start, on a database already +holding a duplicate. Before deploying it, check the database; both queries +must return no rows: + +```sql +SELECT recipe_id, position FROM recipe_ingredients GROUP BY 1, 2 HAVING count(*) > 1; +SELECT recipe_id, position FROM recipe_steps GROUP BY 1, 2 HAVING count(*) > 1; +``` + ## Dinner lifecycle ```