mitai-jinkendo/backend/migrations/066_recipe_ingredient_units.sql
Lars fa542e0fb9
All checks were successful
Deploy Development / deploy (push) Successful in 1m7s
Build Test / pytest-backend (push) Successful in 5s
Build Test / lint-backend (push) Successful in 0s
Build Test / build-frontend (push) Successful in 22s
feat: Listen-Dialog mit Mengen/Einheiten, Mitai ohne Kochrezepte
Roh-Kombinationen statt Rezept-Sprache; Zutaten suchen, EL/TL/Prise auf Gramm. Gekochte Gerichte und Ausbeute bleiben Tandoor.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-12 18:23:01 +02:00

19 lines
803 B
SQL

-- Menge + Einheit an Rezeptzutaten; quantity_g bleibt die Standardeinheit (Gramm).
ALTER TABLE food_recipe_ingredients
ADD COLUMN IF NOT EXISTS quantity_amount NUMERIC(10,3),
ADD COLUMN IF NOT EXISTS source_unit VARCHAR(20);
COMMENT ON COLUMN food_recipe_ingredients.quantity_amount IS 'Menge in source_unit (z. B. 2 TL)';
COMMENT ON COLUMN food_recipe_ingredients.source_unit IS 'Kanonische Einheit: g, ml, el, tl, prise, stück, …';
COMMENT ON COLUMN food_recipe_ingredients.quantity_g IS 'Umrechnung auf Gramm, wenn Faktor bekannt';
UPDATE food_recipe_ingredients
SET quantity_amount = quantity_g, source_unit = 'g'
WHERE quantity_g IS NOT NULL AND quantity_amount IS NULL AND source_unit IS NULL;
DO $$
BEGIN
RAISE NOTICE 'Migration 066: recipe ingredient amount + unit';
END $$;