assessment-model/src/app/db/migrations/0091_fuzzy_doctor_spectrum.sql
2024-09-04 11:17:57 +01:00

14 lines
538 B
SQL

DO $$ BEGIN
CREATE TYPE "document_type" AS ENUM('EPR', 'Condition Report', 'Evidence Report', 'Summary Information', 'Floor Plan', 'Scenario EPR');
EXCEPTION
WHEN duplicate_object THEN null;
END $$;
--> statement-breakpoint
CREATE TABLE IF NOT EXISTS "energy_assessment_documents" (
"id" bigserial PRIMARY KEY NOT NULL,
"uprn" bigint NOT NULL,
"energy_assessment_id" bigint NOT NULL,
"document_type" "document_type" NOT NULL,
"document_location" text NOT NULL,
"uploaded_at" timestamp (6) with time zone DEFAULT now() NOT NULL
);