feat: add batch-cooking sessions (single "mega recipe" with dish sections)
New AI-generated batch-cooking flow: pick N dinners/lunches + servings, get one unified recipe covering a full prep session — merged shopping list, steps tagged per-dish (a step can advance several dishes at once, e.g. a shared oven bake), and per-dish storage (fridge/freezer) + exact day-of reheat/finishing instructions. Schema: recipes.isBatchCook, recipeSteps.appliesTo (dish names), new recipeBatchDishes table. Batch recipes are excluded from the normal /recipes list and live under their own /batch-cooking section. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE "recipe_batch_dishes" (
|
||||
"id" text PRIMARY KEY NOT NULL,
|
||||
"recipe_id" text NOT NULL,
|
||||
"name" text NOT NULL,
|
||||
"description" text,
|
||||
"order" integer DEFAULT 0 NOT NULL,
|
||||
"fridge_days" integer NOT NULL,
|
||||
"freezer_friendly" boolean DEFAULT false NOT NULL,
|
||||
"freezer_note" text,
|
||||
"day_of_instructions" text NOT NULL
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "recipe_steps" ADD COLUMN "applies_to" text[] DEFAULT '{}' NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "recipes" ADD COLUMN "is_batch_cook" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "recipe_batch_dishes" ADD CONSTRAINT "recipe_batch_dishes_recipe_id_recipes_id_fk" FOREIGN KEY ("recipe_id") REFERENCES "public"."recipes"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
CREATE INDEX "recipe_batch_dishes_recipe_idx" ON "recipe_batch_dishes" USING btree ("recipe_id");--> statement-breakpoint
|
||||
CREATE INDEX "recipes_batch_cook_idx" ON "recipes" USING btree ("is_batch_cook");
|
||||
File diff suppressed because it is too large
Load Diff
@@ -204,6 +204,13 @@
|
||||
"when": 1783671061049,
|
||||
"tag": "0028_smiling_ezekiel_stane",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 29,
|
||||
"version": "7",
|
||||
"when": 1783810665920,
|
||||
"tag": "0029_tired_crystal",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user