CREATE TYPE "public"."construction_age_band" AS ENUM('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'Unknown');--> statement-breakpoint
ALTER TYPE "public"."override_component" ADD VALUE 'construction_age_band';--> statement-breakpoint
CREATE TABLE "landlord_construction_age_band_overrides" (
	"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
	"portfolio_id" bigint NOT NULL,
	"description" text NOT NULL,
	"value" "construction_age_band" NOT NULL,
	"source" "override_source" NOT NULL,
	"created_at" timestamp with time zone DEFAULT now() NOT NULL,
	"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
	CONSTRAINT "landlord_construction_age_band_portfolio_description_unique" UNIQUE("portfolio_id","description")
);
--> statement-breakpoint
ALTER TABLE "landlord_construction_age_band_overrides" ADD CONSTRAINT "landlord_construction_age_band_overrides_portfolio_fk" FOREIGN KEY ("portfolio_id") REFERENCES "public"."portfolio"("id") ON DELETE cascade ON UPDATE no action;