CREATE TABLE "funding_package" (
	"id" bigserial PRIMARY KEY NOT NULL,
	"plan_id" bigint NOT NULL,
	"scheme" "depth_unit",
	"created_at" timestamp DEFAULT now() NOT NULL,
	"full_project_funding" real,
	"total_uplift" real,
	"full_project_score" real,
	"partial_project_score" real,
	"uplift_project_score" real
);
--> statement-breakpoint
CREATE TABLE "funding_package_measures" (
	"id" bigserial PRIMARY KEY NOT NULL,
	"funding_package_id" bigint NOT NULL,
	"type" "type" NOT NULL,
	"material_id" bigint NOT NULL,
	"innovation_uplift" real,
	"partial_project_score" real,
	"uplift_project_score" real
);
--> statement-breakpoint
ALTER TABLE "funding_package" ADD CONSTRAINT "funding_package_plan_id_plan_id_fk" FOREIGN KEY ("plan_id") REFERENCES "public"."plan"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "funding_package_measures" ADD CONSTRAINT "funding_package_measures_funding_package_id_funding_package_id_fk" FOREIGN KEY ("funding_package_id") REFERENCES "public"."funding_package"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "funding_package_measures" ADD CONSTRAINT "funding_package_measures_material_id_material_id_fk" FOREIGN KEY ("material_id") REFERENCES "public"."material"("id") ON DELETE no action ON UPDATE no action;