mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-22 08:48:34 +00:00
13 lines
No EOL
959 B
SQL
13 lines
No EOL
959 B
SQL
CREATE TYPE "public"."built_form_type" AS ENUM('Detached', 'Semi-Detached', 'Mid-Terrace', 'End-Terrace', 'Enclosed Mid-Terrace', 'Enclosed End-Terrace', 'Not Recorded', 'Unknown');--> statement-breakpoint
|
|
CREATE TABLE "landlord_built_form_type_overrides" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"portfolio_id" bigint NOT NULL,
|
|
"description" text NOT NULL,
|
|
"value" "built_form_type" 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_built_form_type_overrides_portfolio_description_unique" UNIQUE("portfolio_id","description")
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "landlord_built_form_type_overrides" ADD CONSTRAINT "landlord_built_form_type_overrides_portfolio_id_portfolio_id_fk" FOREIGN KEY ("portfolio_id") REFERENCES "public"."portfolio"("id") ON DELETE cascade ON UPDATE no action; |