CREATE TABLE "cooking_assumption_profiles" (
	"household_id" uuid NOT NULL,
	"canonical_ingredient_id" text NOT NULL,
	"average_eaten_portions" double precision,
	"average_leftover_portions" double precision,
	"observation_count" integer DEFAULT 0 NOT NULL,
	"last_session_answers" jsonb,
	"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
	CONSTRAINT "cooking_assumption_profiles_household_id_canonical_ingredient_id_pk" PRIMARY KEY("household_id","canonical_ingredient_id")
);
--> statement-breakpoint
ALTER TABLE "cooking_sessions" ADD COLUMN "leftover_note" text;--> statement-breakpoint
ALTER TABLE "cooking_assumption_profiles" ADD CONSTRAINT "cooking_assumption_profiles_household_id_households_id_fk" FOREIGN KEY ("household_id") REFERENCES "public"."households"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "cooking_assumption_profiles" ADD CONSTRAINT "cooking_assumption_profiles_canonical_ingredient_id_canonical_ingredients_id_fk" FOREIGN KEY ("canonical_ingredient_id") REFERENCES "public"."canonical_ingredients"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
CREATE INDEX "cooking_assumption_profiles_household_idx" ON "cooking_assumption_profiles" USING btree ("household_id");