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");