mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-07-22 08:48:34 +00:00
14 lines
538 B
SQL
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
|
|
);
|