From 70e4c7630e517da471d923e396e133b06988332c Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Fri, 15 Aug 2025 16:46:37 +0000 Subject: [PATCH 01/10] adding new materials attributes to product db --- drizzle.config.ts | 16 + package.json | 4 +- .../db/migrations/0102_fresh_yellow_claw.sql | 6 + .../db/migrations/0103_redundant_maddog.sql | 1 + .../migrations/0104_awesome_james_howlett.sql | 6 + src/app/db/migrations/0105_third_husk.sql | 1 + src/app/db/migrations/meta/0000_snapshot.json | 22 +- src/app/db/migrations/meta/0001_snapshot.json | 22 +- src/app/db/migrations/meta/0002_snapshot.json | 22 +- src/app/db/migrations/meta/0003_snapshot.json | 107 +- src/app/db/migrations/meta/0004_snapshot.json | 200 +- src/app/db/migrations/meta/0005_snapshot.json | 200 +- src/app/db/migrations/meta/0006_snapshot.json | 212 +- src/app/db/migrations/meta/0007_snapshot.json | 232 +- src/app/db/migrations/meta/0008_snapshot.json | 195 +- src/app/db/migrations/meta/0009_snapshot.json | 215 +- src/app/db/migrations/meta/0010_snapshot.json | 215 +- src/app/db/migrations/meta/0011_snapshot.json | 215 +- src/app/db/migrations/meta/0012_snapshot.json | 215 +- src/app/db/migrations/meta/0013_snapshot.json | 215 +- src/app/db/migrations/meta/0014_snapshot.json | 215 +- src/app/db/migrations/meta/0015_snapshot.json | 215 +- src/app/db/migrations/meta/0016_snapshot.json | 215 +- src/app/db/migrations/meta/0017_snapshot.json | 141 +- src/app/db/migrations/meta/0018_snapshot.json | 203 +- src/app/db/migrations/meta/0019_snapshot.json | 203 +- src/app/db/migrations/meta/0020_snapshot.json | 203 +- src/app/db/migrations/meta/0021_snapshot.json | 203 +- src/app/db/migrations/meta/0022_snapshot.json | 203 +- src/app/db/migrations/meta/0023_snapshot.json | 203 +- src/app/db/migrations/meta/0024_snapshot.json | 290 +- src/app/db/migrations/meta/0025_snapshot.json | 324 +- src/app/db/migrations/meta/0026_snapshot.json | 324 +- src/app/db/migrations/meta/0027_snapshot.json | 330 +- src/app/db/migrations/meta/0028_snapshot.json | 330 +- src/app/db/migrations/meta/0029_snapshot.json | 330 +- src/app/db/migrations/meta/0030_snapshot.json | 330 +- src/app/db/migrations/meta/0031_snapshot.json | 330 +- src/app/db/migrations/meta/0032_snapshot.json | 330 +- src/app/db/migrations/meta/0033_snapshot.json | 330 +- src/app/db/migrations/meta/0034_snapshot.json | 330 +- src/app/db/migrations/meta/0035_snapshot.json | 336 +- src/app/db/migrations/meta/0036_snapshot.json | 345 +- src/app/db/migrations/meta/0037_snapshot.json | 345 +- src/app/db/migrations/meta/0038_snapshot.json | 347 +- src/app/db/migrations/meta/0039_snapshot.json | 349 +- src/app/db/migrations/meta/0040_snapshot.json | 351 +- src/app/db/migrations/meta/0041_snapshot.json | 353 +- src/app/db/migrations/meta/0042_snapshot.json | 355 +- src/app/db/migrations/meta/0043_snapshot.json | 359 +- src/app/db/migrations/meta/0044_snapshot.json | 361 +- src/app/db/migrations/meta/0045_snapshot.json | 361 +- src/app/db/migrations/meta/0046_snapshot.json | 361 +- src/app/db/migrations/meta/0047_snapshot.json | 387 +- src/app/db/migrations/meta/0048_snapshot.json | 387 +- src/app/db/migrations/meta/0049_snapshot.json | 387 +- src/app/db/migrations/meta/0050_snapshot.json | 389 +- src/app/db/migrations/meta/0051_snapshot.json | 389 +- src/app/db/migrations/meta/0052_snapshot.json | 391 +- src/app/db/migrations/meta/0053_snapshot.json | 391 +- src/app/db/migrations/meta/0054_snapshot.json | 399 ++- src/app/db/migrations/meta/0055_snapshot.json | 401 ++- src/app/db/migrations/meta/0056_snapshot.json | 407 ++- src/app/db/migrations/meta/0057_snapshot.json | 407 ++- src/app/db/migrations/meta/0058_snapshot.json | 409 ++- src/app/db/migrations/meta/0059_snapshot.json | 409 ++- src/app/db/migrations/meta/0060_snapshot.json | 409 ++- src/app/db/migrations/meta/0061_snapshot.json | 409 ++- src/app/db/migrations/meta/0062_snapshot.json | 409 ++- src/app/db/migrations/meta/0063_snapshot.json | 431 ++- src/app/db/migrations/meta/0064_snapshot.json | 431 ++- src/app/db/migrations/meta/0065_snapshot.json | 431 ++- src/app/db/migrations/meta/0066_snapshot.json | 431 ++- src/app/db/migrations/meta/0067_snapshot.json | 431 ++- src/app/db/migrations/meta/0068_snapshot.json | 431 ++- src/app/db/migrations/meta/0069_snapshot.json | 431 ++- src/app/db/migrations/meta/0070_snapshot.json | 431 ++- src/app/db/migrations/meta/0071_snapshot.json | 439 ++- src/app/db/migrations/meta/0072_snapshot.json | 439 ++- src/app/db/migrations/meta/0073_snapshot.json | 439 ++- src/app/db/migrations/meta/0074_snapshot.json | 464 ++- src/app/db/migrations/meta/0075_snapshot.json | 472 ++- src/app/db/migrations/meta/0076_snapshot.json | 472 ++- src/app/db/migrations/meta/0077_snapshot.json | 472 ++- src/app/db/migrations/meta/0078_snapshot.json | 472 ++- src/app/db/migrations/meta/0079_snapshot.json | 472 ++- src/app/db/migrations/meta/0080_snapshot.json | 472 ++- src/app/db/migrations/meta/0081_snapshot.json | 472 ++- src/app/db/migrations/meta/0082_snapshot.json | 472 ++- src/app/db/migrations/meta/0083_snapshot.json | 503 +-- src/app/db/migrations/meta/0084_snapshot.json | 503 +-- src/app/db/migrations/meta/0085_snapshot.json | 503 +-- src/app/db/migrations/meta/0086_snapshot.json | 503 +-- src/app/db/migrations/meta/0087_snapshot.json | 503 +-- src/app/db/migrations/meta/0088_snapshot.json | 503 +-- src/app/db/migrations/meta/0089_snapshot.json | 503 +-- src/app/db/migrations/meta/0090_snapshot.json | 503 +-- src/app/db/migrations/meta/0091_snapshot.json | 530 +-- src/app/db/migrations/meta/0092_snapshot.json | 530 +-- src/app/db/migrations/meta/0093_snapshot.json | 532 +-- src/app/db/migrations/meta/0094_snapshot.json | 558 +-- src/app/db/migrations/meta/0095_snapshot.json | 558 +-- src/app/db/migrations/meta/0096_snapshot.json | 560 +-- src/app/db/migrations/meta/0097_snapshot.json | 560 +-- src/app/db/migrations/meta/0098_snapshot.json | 560 +-- src/app/db/migrations/meta/0099_snapshot.json | 562 +-- src/app/db/migrations/meta/0100_snapshot.json | 562 +-- src/app/db/migrations/meta/0101_snapshot.json | 562 +-- src/app/db/migrations/meta/0102_snapshot.json | 3158 ++++++++++++++++ src/app/db/migrations/meta/0103_snapshot.json | 3164 ++++++++++++++++ src/app/db/migrations/meta/0104_snapshot.json | 3170 ++++++++++++++++ src/app/db/migrations/meta/0105_snapshot.json | 3171 +++++++++++++++++ src/app/db/migrations/meta/_journal.json | 28 + src/app/db/schema/materials.ts | 22 + 114 files changed, 34886 insertions(+), 15436 deletions(-) create mode 100644 src/app/db/migrations/0102_fresh_yellow_claw.sql create mode 100644 src/app/db/migrations/0103_redundant_maddog.sql create mode 100644 src/app/db/migrations/0104_awesome_james_howlett.sql create mode 100644 src/app/db/migrations/0105_third_husk.sql create mode 100644 src/app/db/migrations/meta/0102_snapshot.json create mode 100644 src/app/db/migrations/meta/0103_snapshot.json create mode 100644 src/app/db/migrations/meta/0104_snapshot.json create mode 100644 src/app/db/migrations/meta/0105_snapshot.json diff --git a/drizzle.config.ts b/drizzle.config.ts index d0f4098..6738659 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -1,6 +1,22 @@ +import * as dotenv from "dotenv"; import type { Config } from "drizzle-kit"; +dotenv.config({ path: ".env.local" }); + +const isProduction = process.env.VERCEL_ENV === "production"; + export default { schema: "./src/app/db/schema/*", out: "./src/app/db/migrations", + dialect: "postgresql", + dbCredentials: { + host: process.env.DB_HOST!, + port: Number(process.env.DB_PORT!), + user: process.env.DB_USERNAME!, + password: process.env.DB_PASSWORD!, + database: process.env.DB_NAME!, + ssl: isProduction + ? true // strict SSL for prod + : { rejectUnauthorized: false }, // allow self-signed in dev/preview + } } satisfies Config; diff --git a/package.json b/package.json index 44ff6c8..5453349 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "lint": "next lint", "test:e2e:open": "start-server-and-test dev http://localhost:3000 \"cypress open --e2e\"", "test:e2e:run": "cypress run", - "migration:generate": "drizzle-kit generate:pg --config=drizzle.config.ts", - "migration:push": "tsx src/app/db/migrate.ts", + "migration:generate": "drizzle-kit generate", + "migration:push": "drizzle-kit push", "create_user": "tsx src/app/db/create_user.ts" }, "dependencies": { diff --git a/src/app/db/migrations/0102_fresh_yellow_claw.sql b/src/app/db/migrations/0102_fresh_yellow_claw.sql new file mode 100644 index 0000000..cbb26be --- /dev/null +++ b/src/app/db/migrations/0102_fresh_yellow_claw.sql @@ -0,0 +1,6 @@ +CREATE TYPE "public"."size_unit" AS ENUM('kWp', 'kW', 'watt', 'storey');--> statement-breakpoint +ALTER TABLE "material" ADD COLUMN "innovation_rate" real DEFAULT 0;--> statement-breakpoint +ALTER TABLE "material" ADD COLUMN "size" real;--> statement-breakpoint +ALTER TABLE "material" ADD COLUMN "size_unit" "size_unit";--> statement-breakpoint +ALTER TABLE "material" ADD COLUMN "includes_scaffolding" boolean DEFAULT false;--> statement-breakpoint +ALTER TABLE "material" ADD COLUMN "includes_battery" boolean DEFAULT false; \ No newline at end of file diff --git a/src/app/db/migrations/0103_redundant_maddog.sql b/src/app/db/migrations/0103_redundant_maddog.sql new file mode 100644 index 0000000..0310334 --- /dev/null +++ b/src/app/db/migrations/0103_redundant_maddog.sql @@ -0,0 +1 @@ +ALTER TABLE "material" ADD COLUMN "battery_size" real; \ No newline at end of file diff --git a/src/app/db/migrations/0104_awesome_james_howlett.sql b/src/app/db/migrations/0104_awesome_james_howlett.sql new file mode 100644 index 0000000..5f312d2 --- /dev/null +++ b/src/app/db/migrations/0104_awesome_james_howlett.sql @@ -0,0 +1,6 @@ +ALTER TYPE "public"."type" ADD VALUE 'trickle_vent';--> statement-breakpoint +ALTER TYPE "public"."type" ADD VALUE 'door_undercut';--> statement-breakpoint +ALTER TYPE "public"."type" ADD VALUE 'solar_pv';--> statement-breakpoint +ALTER TYPE "public"."type" ADD VALUE 'solar_battery';--> statement-breakpoint +ALTER TYPE "public"."type" ADD VALUE 'scaffolding';--> statement-breakpoint +ALTER TYPE "public"."type" ADD VALUE 'high_heat_retention_storage_heaters'; \ No newline at end of file diff --git a/src/app/db/migrations/0105_third_husk.sql b/src/app/db/migrations/0105_third_husk.sql new file mode 100644 index 0000000..563b982 --- /dev/null +++ b/src/app/db/migrations/0105_third_husk.sql @@ -0,0 +1 @@ +ALTER TYPE "public"."type" ADD VALUE 'sealing_fireplace'; \ No newline at end of file diff --git a/src/app/db/migrations/meta/0000_snapshot.json b/src/app/db/migrations/meta/0000_snapshot.json index 8c61663..fd72713 100644 --- a/src/app/db/migrations/meta/0000_snapshot.json +++ b/src/app/db/migrations/meta/0000_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "9cd7955c-6b58-415a-baab-bab2d5e5ff12", - "prevId": "00000000-0000-0000-0000-000000000000", + "version": "7", + "dialect": "postgresql", "tables": { - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -53,7 +51,11 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": {}, @@ -62,5 +64,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "9cd7955c-6b58-415a-baab-bab2d5e5ff12", + "prevId": "00000000-0000-0000-0000-000000000000", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0001_snapshot.json b/src/app/db/migrations/meta/0001_snapshot.json index a1bdfa8..15e55e8 100644 --- a/src/app/db/migrations/meta/0001_snapshot.json +++ b/src/app/db/migrations/meta/0001_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "1f801509-86d5-48dc-b038-b2319fff0c13", - "prevId": "9cd7955c-6b58-415a-baab-bab2d5e5ff12", + "version": "7", + "dialect": "postgresql", "tables": { - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -55,7 +53,11 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": {}, @@ -64,5 +66,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "1f801509-86d5-48dc-b038-b2319fff0c13", + "prevId": "9cd7955c-6b58-415a-baab-bab2d5e5ff12", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0002_snapshot.json b/src/app/db/migrations/meta/0002_snapshot.json index 8ebb67b..afb2c1a 100644 --- a/src/app/db/migrations/meta/0002_snapshot.json +++ b/src/app/db/migrations/meta/0002_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "4347e9a7-f388-4bac-8860-a482db2a5c8b", - "prevId": "1f801509-86d5-48dc-b038-b2319fff0c13", + "version": "7", + "dialect": "postgresql", "tables": { - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -55,7 +53,11 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": {}, @@ -66,5 +68,11 @@ "columns": { "\"user\".\"name\"": "\"user\".\"firstName\"" } - } + }, + "id": "4347e9a7-f388-4bac-8860-a482db2a5c8b", + "prevId": "1f801509-86d5-48dc-b038-b2319fff0c13", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0003_snapshot.json b/src/app/db/migrations/meta/0003_snapshot.json index 84cd0bf..417a1f3 100644 --- a/src/app/db/migrations/meta/0003_snapshot.json +++ b/src/app/db/migrations/meta/0003_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "e43a69c5-c8ed-4de7-8915-0f0a23455bf1", - "prevId": "4347e9a7-f388-4bac-8860-a482db2a5c8b", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -230,42 +236,49 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -273,5 +286,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "e43a69c5-c8ed-4de7-8915-0f0a23455bf1", + "prevId": "4347e9a7-f388-4bac-8860-a482db2a5c8b", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0004_snapshot.json b/src/app/db/migrations/meta/0004_snapshot.json index 01e2ad7..9978f92 100644 --- a/src/app/db/migrations/meta/0004_snapshot.json +++ b/src/app/db/migrations/meta/0004_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "079698d6-54de-431f-b0ab-151e8d8f5024", - "prevId": "e43a69c5-c8ed-4de7-8915-0f0a23455bf1", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -303,20 +309,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -542,33 +552,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -617,9 +631,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -670,72 +688,82 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "feature_rating": { + "public.feature_rating": { "name": "feature_rating", - "values": { - "Very good": "Very good", - "Good": "Good", - "Poor": "Poor", - "Very poor": "Very poor", - "N/A": "N/A" - } + "schema": "public", + "values": [ + "Very good", + "Good", + "Poor", + "Very poor", + "N/A" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -743,5 +771,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "079698d6-54de-431f-b0ab-151e8d8f5024", + "prevId": "e43a69c5-c8ed-4de7-8915-0f0a23455bf1", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0005_snapshot.json b/src/app/db/migrations/meta/0005_snapshot.json index 38d510e..90e725f 100644 --- a/src/app/db/migrations/meta/0005_snapshot.json +++ b/src/app/db/migrations/meta/0005_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "cbe4ccb7-95d6-4d68-953b-ad5d04fb1b11", - "prevId": "079698d6-54de-431f-b0ab-151e8d8f5024", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -303,20 +309,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -542,33 +552,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -617,9 +631,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -670,72 +688,82 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "feature_rating": { + "public.feature_rating": { "name": "feature_rating", - "values": { - "Very good": "Very good", - "Good": "Good", - "Poor": "Poor", - "Very poor": "Very poor", - "N/A": "N/A" - } + "schema": "public", + "values": [ + "Very good", + "Good", + "Poor", + "Very poor", + "N/A" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -745,5 +773,11 @@ "columns": { "\"property\".\"status\"": "\"property\".\"creation_status\"" } - } + }, + "id": "cbe4ccb7-95d6-4d68-953b-ad5d04fb1b11", + "prevId": "079698d6-54de-431f-b0ab-151e8d8f5024", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0006_snapshot.json b/src/app/db/migrations/meta/0006_snapshot.json index 931665b..2f9b68f 100644 --- a/src/app/db/migrations/meta/0006_snapshot.json +++ b/src/app/db/migrations/meta/0006_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "52af8085-b24e-4d3e-a904-fa532f0903e7", - "prevId": "cbe4ccb7-95d6-4d68-953b-ad5d04fb1b11", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -548,33 +558,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -623,9 +637,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -676,78 +694,88 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "feature_rating": { + "public.feature_rating": { "name": "feature_rating", - "values": { - "Very good": "Very good", - "Good": "Good", - "Poor": "Poor", - "Very poor": "Very poor", - "N/A": "N/A" - } + "schema": "public", + "values": [ + "Very good", + "Good", + "Poor", + "Very poor", + "N/A" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -755,5 +783,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "52af8085-b24e-4d3e-a904-fa532f0903e7", + "prevId": "cbe4ccb7-95d6-4d68-953b-ad5d04fb1b11", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0007_snapshot.json b/src/app/db/migrations/meta/0007_snapshot.json index cf59261..0367e90 100644 --- a/src/app/db/migrations/meta/0007_snapshot.json +++ b/src/app/db/migrations/meta/0007_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "3ecdca6b-811d-4ea7-acf1-8446b314f34d", - "prevId": "52af8085-b24e-4d3e-a904-fa532f0903e7", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -548,33 +558,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -623,9 +637,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -671,33 +689,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -748,78 +770,88 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "feature_rating": { + "public.feature_rating": { "name": "feature_rating", - "values": { - "Very good": "Very good", - "Good": "Good", - "Poor": "Poor", - "Very poor": "Very poor", - "N/A": "N/A" - } + "schema": "public", + "values": [ + "Very good", + "Good", + "Poor", + "Very poor", + "N/A" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -827,5 +859,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "3ecdca6b-811d-4ea7-acf1-8446b314f34d", + "prevId": "52af8085-b24e-4d3e-a904-fa532f0903e7", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0008_snapshot.json b/src/app/db/migrations/meta/0008_snapshot.json index 8103167..31ca95d 100644 --- a/src/app/db/migrations/meta/0008_snapshot.json +++ b/src/app/db/migrations/meta/0008_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "45322acf-f86a-40b5-a3e3-197e54bf05e1", - "prevId": "3ecdca6b-811d-4ea7-acf1-8446b314f34d", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -371,9 +381,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -419,33 +433,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -496,68 +514,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -565,5 +592,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "45322acf-f86a-40b5-a3e3-197e54bf05e1", + "prevId": "3ecdca6b-811d-4ea7-acf1-8446b314f34d", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0009_snapshot.json b/src/app/db/migrations/meta/0009_snapshot.json index 04c98a1..37e7298 100644 --- a/src/app/db/migrations/meta/0009_snapshot.json +++ b/src/app/db/migrations/meta/0009_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "0bfd5e66-cc1e-4044-8a61-df55554f16b4", - "prevId": "45322acf-f86a-40b5-a3e3-197e54bf05e1", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -548,33 +558,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -623,9 +637,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -671,33 +689,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -748,68 +770,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -817,5 +848,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "0bfd5e66-cc1e-4044-8a61-df55554f16b4", + "prevId": "45322acf-f86a-40b5-a3e3-197e54bf05e1", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0010_snapshot.json b/src/app/db/migrations/meta/0010_snapshot.json index e5f94ae..5709ecc 100644 --- a/src/app/db/migrations/meta/0010_snapshot.json +++ b/src/app/db/migrations/meta/0010_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "e0d76bd5-8361-40d7-b6bb-0d22478ae4db", - "prevId": "0bfd5e66-cc1e-4044-8a61-df55554f16b4", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -548,33 +558,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -623,9 +637,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -671,33 +689,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -748,68 +770,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -817,5 +848,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "e0d76bd5-8361-40d7-b6bb-0d22478ae4db", + "prevId": "0bfd5e66-cc1e-4044-8a61-df55554f16b4", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0011_snapshot.json b/src/app/db/migrations/meta/0011_snapshot.json index 6032757..8d1c592 100644 --- a/src/app/db/migrations/meta/0011_snapshot.json +++ b/src/app/db/migrations/meta/0011_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "e376c439-1810-4d3b-a7a1-0e31be504faf", - "prevId": "e0d76bd5-8361-40d7-b6bb-0d22478ae4db", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -548,33 +558,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -623,9 +637,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -671,33 +689,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -748,68 +770,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -817,5 +848,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "e376c439-1810-4d3b-a7a1-0e31be504faf", + "prevId": "e0d76bd5-8361-40d7-b6bb-0d22478ae4db", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0012_snapshot.json b/src/app/db/migrations/meta/0012_snapshot.json index ae28780..385b432 100644 --- a/src/app/db/migrations/meta/0012_snapshot.json +++ b/src/app/db/migrations/meta/0012_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "a3f791d4-ed1d-44b1-ade9-d60b7fcb3ac1", - "prevId": "e376c439-1810-4d3b-a7a1-0e31be504faf", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -548,33 +558,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -623,9 +637,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -671,33 +689,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -748,68 +770,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -817,5 +848,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "a3f791d4-ed1d-44b1-ade9-d60b7fcb3ac1", + "prevId": "e376c439-1810-4d3b-a7a1-0e31be504faf", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0013_snapshot.json b/src/app/db/migrations/meta/0013_snapshot.json index f1ca5d7..2dad0c2 100644 --- a/src/app/db/migrations/meta/0013_snapshot.json +++ b/src/app/db/migrations/meta/0013_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "5bb4c724-b933-4dda-9ebd-5c57b88236bb", - "prevId": "a3f791d4-ed1d-44b1-ade9-d60b7fcb3ac1", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -560,33 +570,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -635,9 +649,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -683,33 +701,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -760,68 +782,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -829,5 +860,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "5bb4c724-b933-4dda-9ebd-5c57b88236bb", + "prevId": "a3f791d4-ed1d-44b1-ade9-d60b7fcb3ac1", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0014_snapshot.json b/src/app/db/migrations/meta/0014_snapshot.json index 87df80c..ded5be7 100644 --- a/src/app/db/migrations/meta/0014_snapshot.json +++ b/src/app/db/migrations/meta/0014_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "be2b61bd-d1de-42c6-a29f-c1fbb0d2b6ba", - "prevId": "5bb4c724-b933-4dda-9ebd-5c57b88236bb", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -309,20 +315,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -554,33 +564,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -629,9 +643,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -677,33 +695,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -754,68 +776,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -823,5 +854,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "be2b61bd-d1de-42c6-a29f-c1fbb0d2b6ba", + "prevId": "5bb4c724-b933-4dda-9ebd-5c57b88236bb", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0015_snapshot.json b/src/app/db/migrations/meta/0015_snapshot.json index 2f0b84c..22aaa74 100644 --- a/src/app/db/migrations/meta/0015_snapshot.json +++ b/src/app/db/migrations/meta/0015_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "ca7875cc-1de8-49e0-a78c-276cb7a9ec15", - "prevId": "be2b61bd-d1de-42c6-a29f-c1fbb0d2b6ba", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -315,20 +321,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -560,33 +570,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -635,9 +649,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -683,33 +701,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -760,68 +782,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -829,5 +860,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "ca7875cc-1de8-49e0-a78c-276cb7a9ec15", + "prevId": "be2b61bd-d1de-42c6-a29f-c1fbb0d2b6ba", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0016_snapshot.json b/src/app/db/migrations/meta/0016_snapshot.json index 4a9f5c3..7ca5332 100644 --- a/src/app/db/migrations/meta/0016_snapshot.json +++ b/src/app/db/migrations/meta/0016_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "6c36dd91-3c26-4c47-882f-c38ba4ccd275", - "prevId": "ca7875cc-1de8-49e0-a78c-276cb7a9ec15", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -317,20 +323,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -562,33 +572,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -637,9 +651,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -686,33 +704,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -763,68 +785,77 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "property_status": { + "public.property_status": { "name": "property_status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] } }, "schemas": {}, @@ -832,5 +863,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "6c36dd91-3c26-4c47-882f-c38ba4ccd275", + "prevId": "ca7875cc-1de8-49e0-a78c-276cb7a9ec15", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0017_snapshot.json b/src/app/db/migrations/meta/0017_snapshot.json index fe51473..409e1fa 100644 --- a/src/app/db/migrations/meta/0017_snapshot.json +++ b/src/app/db/migrations/meta/0017_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "7fe62fb1-7270-4a1b-8f2a-582b1efdc6c9", - "prevId": "6c36dd91-3c26-4c47-882f-c38ba4ccd275", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -230,62 +236,71 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -293,5 +308,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "7fe62fb1-7270-4a1b-8f2a-582b1efdc6c9", + "prevId": "6c36dd91-3c26-4c47-882f-c38ba4ccd275", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0018_snapshot.json b/src/app/db/migrations/meta/0018_snapshot.json index 6d5cd66..9d691de 100644 --- a/src/app/db/migrations/meta/0018_snapshot.json +++ b/src/app/db/migrations/meta/0018_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "35b1337c-37e3-4e94-8c5e-075d64ee4d41", - "prevId": "7fe62fb1-7270-4a1b-8f2a-582b1efdc6c9", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -317,20 +323,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -562,33 +572,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -637,9 +651,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -686,33 +704,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -763,62 +785,71 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -826,5 +857,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "35b1337c-37e3-4e94-8c5e-075d64ee4d41", + "prevId": "7fe62fb1-7270-4a1b-8f2a-582b1efdc6c9", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0019_snapshot.json b/src/app/db/migrations/meta/0019_snapshot.json index 5e98fdd..7e068bd 100644 --- a/src/app/db/migrations/meta/0019_snapshot.json +++ b/src/app/db/migrations/meta/0019_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "2501e06e-b010-4eab-8b98-fea030e533e3", - "prevId": "35b1337c-37e3-4e94-8c5e-075d64ee4d41", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -317,20 +323,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -562,33 +572,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -637,9 +651,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -686,33 +704,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -763,62 +785,71 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -826,5 +857,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "2501e06e-b010-4eab-8b98-fea030e533e3", + "prevId": "35b1337c-37e3-4e94-8c5e-075d64ee4d41", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0020_snapshot.json b/src/app/db/migrations/meta/0020_snapshot.json index 6ac7861..3c88324 100644 --- a/src/app/db/migrations/meta/0020_snapshot.json +++ b/src/app/db/migrations/meta/0020_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "2a18a773-c7ce-4a1e-90f5-e189b9865f00", - "prevId": "2501e06e-b010-4eab-8b98-fea030e533e3", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -317,20 +323,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -562,33 +572,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -637,9 +651,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -686,33 +704,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -763,62 +785,71 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -826,5 +857,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "2a18a773-c7ce-4a1e-90f5-e189b9865f00", + "prevId": "2501e06e-b010-4eab-8b98-fea030e533e3", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0021_snapshot.json b/src/app/db/migrations/meta/0021_snapshot.json index 64e24a5..7cd7c64 100644 --- a/src/app/db/migrations/meta/0021_snapshot.json +++ b/src/app/db/migrations/meta/0021_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "3ba812ef-9ba9-4493-a37b-1d9f8ceaf30b", - "prevId": "2a18a773-c7ce-4a1e-90f5-e189b9865f00", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -317,20 +323,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -562,33 +572,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -637,9 +651,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -686,33 +704,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -763,62 +785,71 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -826,5 +857,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "3ba812ef-9ba9-4493-a37b-1d9f8ceaf30b", + "prevId": "2a18a773-c7ce-4a1e-90f5-e189b9865f00", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0022_snapshot.json b/src/app/db/migrations/meta/0022_snapshot.json index 67fa35a..8bdc157 100644 --- a/src/app/db/migrations/meta/0022_snapshot.json +++ b/src/app/db/migrations/meta/0022_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "65f0ce76-b171-4bca-b56d-15ddbbda437c", - "prevId": "3ba812ef-9ba9-4493-a37b-1d9f8ceaf30b", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -317,20 +323,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -562,33 +572,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -637,9 +651,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -686,33 +704,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -763,62 +785,71 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -829,5 +860,11 @@ "\"property_details_epc\".\"heating_contols\"": "\"property_details_epc\".\"heating_controls\"", "\"property_details_epc\".\"heating_contols_rating\"": "\"property_details_epc\".\"heating_controls_rating\"" } - } + }, + "id": "65f0ce76-b171-4bca-b56d-15ddbbda437c", + "prevId": "3ba812ef-9ba9-4493-a37b-1d9f8ceaf30b", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0023_snapshot.json b/src/app/db/migrations/meta/0023_snapshot.json index 54e3241..32ddc6d 100644 --- a/src/app/db/migrations/meta/0023_snapshot.json +++ b/src/app/db/migrations/meta/0023_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "f0a25da5-b02d-4255-9107-ac8c252e7eb9", - "prevId": "65f0ce76-b171-4bca-b56d-15ddbbda437c", + "version": "7", + "dialect": "postgresql", "tables": { - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -103,9 +101,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -153,33 +155,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -317,20 +323,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -562,33 +572,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -637,9 +651,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -686,33 +704,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -763,62 +785,71 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -826,5 +857,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "f0a25da5-b02d-4255-9107-ac8c252e7eb9", + "prevId": "65f0ce76-b171-4bca-b56d-15ddbbda437c", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0024_snapshot.json b/src/app/db/migrations/meta/0024_snapshot.json index 41f265d..2fd3fde 100644 --- a/src/app/db/migrations/meta/0024_snapshot.json +++ b/src/app/db/migrations/meta/0024_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "b27408a9-7d8c-4728-86f7-00c18777ca09", - "prevId": "f0a25da5-b02d-4255-9107-ac8c252e7eb9", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -862,9 +888,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -899,33 +929,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -976,95 +1010,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1072,5 +1120,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "b27408a9-7d8c-4728-86f7-00c18777ca09", + "prevId": "f0a25da5-b02d-4255-9107-ac8c252e7eb9", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0025_snapshot.json b/src/app/db/migrations/meta/0025_snapshot.json index 40027d4..87bee60 100644 --- a/src/app/db/migrations/meta/0025_snapshot.json +++ b/src/app/db/migrations/meta/0025_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "33cd3919-da77-4cac-a08b-b6d1443fc63d", - "prevId": "b27408a9-7d8c-4728-86f7-00c18777ca09", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -826,9 +852,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -856,33 +886,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -989,20 +1023,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1037,33 +1075,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1114,95 +1156,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1210,5 +1266,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "33cd3919-da77-4cac-a08b-b6d1443fc63d", + "prevId": "b27408a9-7d8c-4728-86f7-00c18777ca09", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0026_snapshot.json b/src/app/db/migrations/meta/0026_snapshot.json index 81f8175..22d43ad 100644 --- a/src/app/db/migrations/meta/0026_snapshot.json +++ b/src/app/db/migrations/meta/0026_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "4696d604-5b36-41ff-bea4-b12141430fc8", - "prevId": "33cd3919-da77-4cac-a08b-b6d1443fc63d", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -826,9 +852,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -856,33 +886,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -989,20 +1023,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1037,33 +1075,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1114,95 +1156,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1212,5 +1268,11 @@ "columns": { "\"material\".\"json\"": "\"material\".\"depths\"" } - } + }, + "id": "4696d604-5b36-41ff-bea4-b12141430fc8", + "prevId": "33cd3919-da77-4cac-a08b-b6d1443fc63d", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0027_snapshot.json b/src/app/db/migrations/meta/0027_snapshot.json index 9dd2052..b6e4304 100644 --- a/src/app/db/migrations/meta/0027_snapshot.json +++ b/src/app/db/migrations/meta/0027_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "bb5632f2-c033-4357-8170-e8869fe6d8ee", - "prevId": "4696d604-5b36-41ff-bea4-b12141430fc8", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -835,20 +861,24 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -876,33 +906,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1009,20 +1043,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1057,33 +1095,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1134,95 +1176,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1230,5 +1286,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "bb5632f2-c033-4357-8170-e8869fe6d8ee", + "prevId": "4696d604-5b36-41ff-bea4-b12141430fc8", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0028_snapshot.json b/src/app/db/migrations/meta/0028_snapshot.json index af50ac5..0c0aaaf 100644 --- a/src/app/db/migrations/meta/0028_snapshot.json +++ b/src/app/db/migrations/meta/0028_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "a818a7fa-3ab6-40e5-b153-16c2185d1169", - "prevId": "bb5632f2-c033-4357-8170-e8869fe6d8ee", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -835,20 +861,24 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -876,33 +906,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1015,20 +1049,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1063,33 +1101,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1140,95 +1182,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1236,5 +1292,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "a818a7fa-3ab6-40e5-b153-16c2185d1169", + "prevId": "bb5632f2-c033-4357-8170-e8869fe6d8ee", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0029_snapshot.json b/src/app/db/migrations/meta/0029_snapshot.json index 428474d..95ea305 100644 --- a/src/app/db/migrations/meta/0029_snapshot.json +++ b/src/app/db/migrations/meta/0029_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "5d56ea08-3ea2-4c72-8b80-42426b651590", - "prevId": "a818a7fa-3ab6-40e5-b153-16c2185d1169", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -835,20 +861,24 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -876,33 +906,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1015,20 +1049,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1069,33 +1107,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1146,95 +1188,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1242,5 +1298,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "5d56ea08-3ea2-4c72-8b80-42426b651590", + "prevId": "a818a7fa-3ab6-40e5-b153-16c2185d1169", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0030_snapshot.json b/src/app/db/migrations/meta/0030_snapshot.json index 4227503..bfc235d 100644 --- a/src/app/db/migrations/meta/0030_snapshot.json +++ b/src/app/db/migrations/meta/0030_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "d8d7414e-bbaa-4119-b89d-288d352f937f", - "prevId": "5d56ea08-3ea2-4c72-8b80-42426b651590", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -835,20 +861,24 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -876,33 +906,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1015,20 +1049,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1063,33 +1101,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1140,95 +1182,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1236,5 +1292,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "d8d7414e-bbaa-4119-b89d-288d352f937f", + "prevId": "5d56ea08-3ea2-4c72-8b80-42426b651590", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0031_snapshot.json b/src/app/db/migrations/meta/0031_snapshot.json index b4523a0..105f1f3 100644 --- a/src/app/db/migrations/meta/0031_snapshot.json +++ b/src/app/db/migrations/meta/0031_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "37455471-99bf-4e0c-b4b8-fef2d639cac3", - "prevId": "d8d7414e-bbaa-4119-b89d-288d352f937f", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -835,20 +861,24 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -876,33 +906,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1015,20 +1049,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1069,33 +1107,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1146,95 +1188,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1242,5 +1298,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "37455471-99bf-4e0c-b4b8-fef2d639cac3", + "prevId": "d8d7414e-bbaa-4119-b89d-288d352f937f", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0032_snapshot.json b/src/app/db/migrations/meta/0032_snapshot.json index d0930ea..6684ac4 100644 --- a/src/app/db/migrations/meta/0032_snapshot.json +++ b/src/app/db/migrations/meta/0032_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "af61ab3b-0475-4c45-9ad7-1d3de0b4b5c0", - "prevId": "37455471-99bf-4e0c-b4b8-fef2d639cac3", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -84,9 +82,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -185,9 +187,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -235,33 +241,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -399,20 +409,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -644,33 +658,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -719,9 +737,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -768,33 +790,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -829,20 +855,24 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -870,33 +900,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1009,20 +1043,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1063,33 +1101,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1140,95 +1182,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1236,5 +1292,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "af61ab3b-0475-4c45-9ad7-1d3de0b4b5c0", + "prevId": "37455471-99bf-4e0c-b4b8-fef2d639cac3", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0033_snapshot.json b/src/app/db/migrations/meta/0033_snapshot.json index 5981432..9aa0a1c 100644 --- a/src/app/db/migrations/meta/0033_snapshot.json +++ b/src/app/db/migrations/meta/0033_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "89fbe469-4b9e-4396-bc6c-f74d3389ec0b", - "prevId": "af61ab3b-0475-4c45-9ad7-1d3de0b4b5c0", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -90,9 +88,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -191,9 +193,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -241,33 +247,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -405,20 +415,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -650,33 +664,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -725,9 +743,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -774,33 +796,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -835,20 +861,24 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -876,33 +906,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1015,20 +1049,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1069,33 +1107,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1146,95 +1188,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1242,5 +1298,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "89fbe469-4b9e-4396-bc6c-f74d3389ec0b", + "prevId": "af61ab3b-0475-4c45-9ad7-1d3de0b4b5c0", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0034_snapshot.json b/src/app/db/migrations/meta/0034_snapshot.json index d7fb143..bcc7602 100644 --- a/src/app/db/migrations/meta/0034_snapshot.json +++ b/src/app/db/migrations/meta/0034_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "2508c58f-bee6-44b6-9617-464c78540cf6", - "prevId": "89fbe469-4b9e-4396-bc6c-f74d3389ec0b", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -842,20 +868,24 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -883,33 +913,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1022,20 +1056,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1076,33 +1114,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1153,95 +1195,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1249,5 +1305,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "2508c58f-bee6-44b6-9617-464c78540cf6", + "prevId": "89fbe469-4b9e-4396-bc6c-f74d3389ec0b", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0035_snapshot.json b/src/app/db/migrations/meta/0035_snapshot.json index 1cc6b1a..4c1d14e 100644 --- a/src/app/db/migrations/meta/0035_snapshot.json +++ b/src/app/db/migrations/meta/0035_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "976fba8c-569b-4257-a6fe-c0ae0d9e0e01", - "prevId": "2508c58f-bee6-44b6-9617-464c78540cf6", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1095,33 +1133,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1172,95 +1214,109 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] } }, "schemas": {}, @@ -1268,5 +1324,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "976fba8c-569b-4257-a6fe-c0ae0d9e0e01", + "prevId": "2508c58f-bee6-44b6-9617-464c78540cf6", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0036_snapshot.json b/src/app/db/migrations/meta/0036_snapshot.json index 820b9ad..837584b 100644 --- a/src/app/db/migrations/meta/0036_snapshot.json +++ b/src/app/db/migrations/meta/0036_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "2063f8e7-e1b2-486a-8e64-6a8a24b631d2", - "prevId": "976fba8c-569b-4257-a6fe-c0ae0d9e0e01", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,101 +1232,116 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "meters_squared": "meters_squared" - } + "schema": "public", + "values": [ + "meters_squared" + ] } }, "schemas": {}, @@ -1292,5 +1349,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "2063f8e7-e1b2-486a-8e64-6a8a24b631d2", + "prevId": "976fba8c-569b-4257-a6fe-c0ae0d9e0e01", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0037_snapshot.json b/src/app/db/migrations/meta/0037_snapshot.json index b2d5069..14541cc 100644 --- a/src/app/db/migrations/meta/0037_snapshot.json +++ b/src/app/db/migrations/meta/0037_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "ae896627-43c0-4d11-972f-a042af3bf845", - "prevId": "2063f8e7-e1b2-486a-8e64-6a8a24b631d2", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,101 +1232,116 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2" - } + "schema": "public", + "values": [ + "m2" + ] } }, "schemas": {}, @@ -1292,5 +1349,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "ae896627-43c0-4d11-972f-a042af3bf845", + "prevId": "2063f8e7-e1b2-486a-8e64-6a8a24b631d2", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0038_snapshot.json b/src/app/db/migrations/meta/0038_snapshot.json index 4a70222..123ef2c 100644 --- a/src/app/db/migrations/meta/0038_snapshot.json +++ b/src/app/db/migrations/meta/0038_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "fd9090e8-9549-4e88-9327-96985637c701", - "prevId": "ae896627-43c0-4d11-972f-a042af3bf845", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,102 +1232,117 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2" - } + "schema": "public", + "values": [ + "m2" + ] } }, "schemas": {}, @@ -1293,5 +1350,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "fd9090e8-9549-4e88-9327-96985637c701", + "prevId": "ae896627-43c0-4d11-972f-a042af3bf845", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0039_snapshot.json b/src/app/db/migrations/meta/0039_snapshot.json index 4c8cc1e..10d8334 100644 --- a/src/app/db/migrations/meta/0039_snapshot.json +++ b/src/app/db/migrations/meta/0039_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "4d09669b-91d3-4a32-b375-1b4d44c8144a", - "prevId": "fd9090e8-9549-4e88-9327-96985637c701", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,103 +1232,118 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter" - } + "schema": "public", + "values": [ + "gbp_sq_meter" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2" - } + "schema": "public", + "values": [ + "m2" + ] } }, "schemas": {}, @@ -1294,5 +1351,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "4d09669b-91d3-4a32-b375-1b4d44c8144a", + "prevId": "fd9090e8-9549-4e88-9327-96985637c701", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0040_snapshot.json b/src/app/db/migrations/meta/0040_snapshot.json index 6283ae4..18583c2 100644 --- a/src/app/db/migrations/meta/0040_snapshot.json +++ b/src/app/db/migrations/meta/0040_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "fefa7c2c-3176-4db9-981f-dd158e85ca56", - "prevId": "4d09669b-91d3-4a32-b375-1b4d44c8144a", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,104 +1232,119 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2" - } + "schema": "public", + "values": [ + "m2" + ] } }, "schemas": {}, @@ -1295,5 +1352,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "fefa7c2c-3176-4db9-981f-dd158e85ca56", + "prevId": "4d09669b-91d3-4a32-b375-1b4d44c8144a", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0041_snapshot.json b/src/app/db/migrations/meta/0041_snapshot.json index dfe4e54..bf73f6b 100644 --- a/src/app/db/migrations/meta/0041_snapshot.json +++ b/src/app/db/migrations/meta/0041_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "aac01c9d-d058-475f-a81e-40565d4dd64d", - "prevId": "fefa7c2c-3176-4db9-981f-dd158e85ca56", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,105 +1232,120 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2" - } + "schema": "public", + "values": [ + "m2" + ] } }, "schemas": {}, @@ -1296,5 +1353,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "aac01c9d-d058-475f-a81e-40565d4dd64d", + "prevId": "fefa7c2c-3176-4db9-981f-dd158e85ca56", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0042_snapshot.json b/src/app/db/migrations/meta/0042_snapshot.json index c5327ca..e571ce5 100644 --- a/src/app/db/migrations/meta/0042_snapshot.json +++ b/src/app/db/migrations/meta/0042_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "5dd17ecd-c7b6-4282-ad4d-e559fafdff94", - "prevId": "aac01c9d-d058-475f-a81e-40565d4dd64d", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,106 +1232,121 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2" - } + "schema": "public", + "values": [ + "m2" + ] } }, "schemas": {}, @@ -1297,5 +1354,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "5dd17ecd-c7b6-4282-ad4d-e559fafdff94", + "prevId": "aac01c9d-d058-475f-a81e-40565d4dd64d", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0043_snapshot.json b/src/app/db/migrations/meta/0043_snapshot.json index d3b5313..42907b5 100644 --- a/src/app/db/migrations/meta/0043_snapshot.json +++ b/src/app/db/migrations/meta/0043_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "857e8595-a16d-4119-8a78-9d864c92fbb0", - "prevId": "5dd17ecd-c7b6-4282-ad4d-e559fafdff94", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,108 +1232,123 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2" - } + "schema": "public", + "values": [ + "m2" + ] } }, "schemas": {}, @@ -1299,5 +1356,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "857e8595-a16d-4119-8a78-9d864c92fbb0", + "prevId": "5dd17ecd-c7b6-4282-ad4d-e559fafdff94", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0044_snapshot.json b/src/app/db/migrations/meta/0044_snapshot.json index daf70c4..e599592 100644 --- a/src/app/db/migrations/meta/0044_snapshot.json +++ b/src/app/db/migrations/meta/0044_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "d32382e5-987e-4c9e-843e-4f1142dd2dee", - "prevId": "857e8595-a16d-4119-8a78-9d864c92fbb0", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,109 +1232,124 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1300,5 +1357,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "d32382e5-987e-4c9e-843e-4f1142dd2dee", + "prevId": "857e8595-a16d-4119-8a78-9d864c92fbb0", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0045_snapshot.json b/src/app/db/migrations/meta/0045_snapshot.json index b1af534..0890a1d 100644 --- a/src/app/db/migrations/meta/0045_snapshot.json +++ b/src/app/db/migrations/meta/0045_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "e5f61c1d-5ff6-4905-a775-1f3ad51ab735", - "prevId": "d32382e5-987e-4c9e-843e-4f1142dd2dee", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -97,9 +95,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -198,9 +200,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -248,33 +254,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -412,20 +422,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -657,33 +671,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -732,9 +750,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -781,33 +803,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -848,33 +874,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -902,33 +932,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1041,20 +1075,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1113,33 +1151,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1190,109 +1232,124 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1302,5 +1359,11 @@ "columns": { "\"material\".\"depths\"": "\"material\".\"depth\"" } - } + }, + "id": "e5f61c1d-5ff6-4905-a775-1f3ad51ab735", + "prevId": "d32382e5-987e-4c9e-843e-4f1142dd2dee", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0046_snapshot.json b/src/app/db/migrations/meta/0046_snapshot.json index 46f12a1..90b0716 100644 --- a/src/app/db/migrations/meta/0046_snapshot.json +++ b/src/app/db/migrations/meta/0046_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "c2fc8f22-9118-4b41-942d-a952c8473416", - "prevId": "e5f61c1d-5ff6-4905-a775-1f3ad51ab735", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -133,9 +131,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -234,9 +236,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -284,33 +290,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -448,20 +458,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -693,33 +707,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -768,9 +786,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -817,33 +839,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -884,33 +910,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -938,33 +968,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1077,20 +1111,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1149,33 +1187,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1226,109 +1268,124 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1336,5 +1393,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "c2fc8f22-9118-4b41-942d-a952c8473416", + "prevId": "e5f61c1d-5ff6-4905-a775-1f3ad51ab735", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0047_snapshot.json b/src/app/db/migrations/meta/0047_snapshot.json index 428d26d..f162561 100644 --- a/src/app/db/migrations/meta/0047_snapshot.json +++ b/src/app/db/migrations/meta/0047_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "66e46a4c-0610-4b0f-a6f7-20a3eea5a6de", - "prevId": "c2fc8f22-9118-4b41-942d-a952c8473416", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -133,9 +131,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -234,9 +236,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -284,33 +290,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -448,20 +458,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -693,33 +707,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -768,9 +786,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -817,33 +839,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -884,33 +910,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -938,33 +968,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1077,20 +1111,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1149,33 +1187,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1226,122 +1268,137 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1349,5 +1406,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "66e46a4c-0610-4b0f-a6f7-20a3eea5a6de", + "prevId": "c2fc8f22-9118-4b41-942d-a952c8473416", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0048_snapshot.json b/src/app/db/migrations/meta/0048_snapshot.json index fac1f7b..ec50ce0 100644 --- a/src/app/db/migrations/meta/0048_snapshot.json +++ b/src/app/db/migrations/meta/0048_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "06bd4604-96d0-4935-a00b-162aabd9bf78", - "prevId": "66e46a4c-0610-4b0f-a6f7-20a3eea5a6de", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -240,9 +242,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -290,33 +296,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -454,20 +464,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -699,33 +713,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -774,9 +792,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -823,33 +845,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -890,33 +916,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -944,33 +974,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1083,20 +1117,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1155,33 +1193,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1232,122 +1274,137 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1355,5 +1412,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "06bd4604-96d0-4935-a00b-162aabd9bf78", + "prevId": "66e46a4c-0610-4b0f-a6f7-20a3eea5a6de", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0049_snapshot.json b/src/app/db/migrations/meta/0049_snapshot.json index 3f375c1..cbe3b2c 100644 --- a/src/app/db/migrations/meta/0049_snapshot.json +++ b/src/app/db/migrations/meta/0049_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "72eeb7e2-79f5-4cb2-9725-636261612926", - "prevId": "06bd4604-96d0-4935-a00b-162aabd9bf78", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -240,9 +242,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -290,33 +296,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -454,20 +464,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -699,33 +713,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -774,9 +792,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -823,33 +845,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -890,33 +916,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -944,33 +974,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1083,20 +1117,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1155,33 +1193,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1232,122 +1274,137 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1357,5 +1414,11 @@ "columns": { "\"material\".\"labour_cost_per_unit\"": "\"material\".\"labour_hours_per_unit\"" } - } + }, + "id": "72eeb7e2-79f5-4cb2-9725-636261612926", + "prevId": "06bd4604-96d0-4935-a00b-162aabd9bf78", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0050_snapshot.json b/src/app/db/migrations/meta/0050_snapshot.json index 99ad07f..7fbf8a5 100644 --- a/src/app/db/migrations/meta/0050_snapshot.json +++ b/src/app/db/migrations/meta/0050_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "bd383ade-faaf-4956-b0d6-1ee0a35580be", - "prevId": "72eeb7e2-79f5-4cb2-9725-636261612926", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -240,9 +242,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -290,33 +296,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -454,20 +464,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -699,33 +713,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -774,9 +792,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -823,33 +845,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -890,33 +916,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -944,33 +974,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1083,20 +1117,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1155,33 +1193,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1232,123 +1274,138 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1356,5 +1413,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "bd383ade-faaf-4956-b0d6-1ee0a35580be", + "prevId": "72eeb7e2-79f5-4cb2-9725-636261612926", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0051_snapshot.json b/src/app/db/migrations/meta/0051_snapshot.json index 1912ceb..3886d94 100644 --- a/src/app/db/migrations/meta/0051_snapshot.json +++ b/src/app/db/migrations/meta/0051_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "82c0b2f5-d410-413f-90b8-88a2db3130fa", - "prevId": "bd383ade-faaf-4956-b0d6-1ee0a35580be", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -705,33 +719,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -780,9 +798,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -829,33 +851,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -896,33 +922,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -950,33 +980,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1095,20 +1129,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1167,33 +1205,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1244,123 +1286,138 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1368,5 +1425,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "82c0b2f5-d410-413f-90b8-88a2db3130fa", + "prevId": "bd383ade-faaf-4956-b0d6-1ee0a35580be", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0052_snapshot.json b/src/app/db/migrations/meta/0052_snapshot.json index 4378be4..3edf42e 100644 --- a/src/app/db/migrations/meta/0052_snapshot.json +++ b/src/app/db/migrations/meta/0052_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "f3105b0f-ca76-42ac-8f2e-020daefd08cf", - "prevId": "82c0b2f5-d410-413f-90b8-88a2db3130fa", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -705,33 +719,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -780,9 +798,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -829,33 +851,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -896,33 +922,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -950,33 +980,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1095,20 +1129,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1167,33 +1205,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1244,124 +1286,139 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1369,5 +1426,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "f3105b0f-ca76-42ac-8f2e-020daefd08cf", + "prevId": "82c0b2f5-d410-413f-90b8-88a2db3130fa", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0053_snapshot.json b/src/app/db/migrations/meta/0053_snapshot.json index 71de1f4..03a128e 100644 --- a/src/app/db/migrations/meta/0053_snapshot.json +++ b/src/app/db/migrations/meta/0053_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "5bab96d7-f042-492e-a08f-a2ad4e7a2f69", - "prevId": "f3105b0f-ca76-42ac-8f2e-020daefd08cf", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -711,33 +725,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -786,9 +804,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -835,33 +857,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -902,33 +928,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -956,33 +986,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1101,20 +1135,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1173,33 +1211,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1250,124 +1292,139 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1375,5 +1432,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "5bab96d7-f042-492e-a08f-a2ad4e7a2f69", + "prevId": "f3105b0f-ca76-42ac-8f2e-020daefd08cf", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0054_snapshot.json b/src/app/db/migrations/meta/0054_snapshot.json index cd1fb13..dcfffe6 100644 --- a/src/app/db/migrations/meta/0054_snapshot.json +++ b/src/app/db/migrations/meta/0054_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "b92e97d1-c6e9-4749-b205-ad3cf5470a4d", - "prevId": "5bab96d7-f042-492e-a08f-a2ad4e7a2f69", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -711,33 +725,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -786,9 +804,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -849,9 +871,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -898,33 +924,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -965,33 +995,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1019,33 +1053,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1164,20 +1202,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1236,33 +1278,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1313,124 +1359,139 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1438,5 +1499,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "b92e97d1-c6e9-4749-b205-ad3cf5470a4d", + "prevId": "5bab96d7-f042-492e-a08f-a2ad4e7a2f69", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0055_snapshot.json b/src/app/db/migrations/meta/0055_snapshot.json index c9c9ed3..7f64c63 100644 --- a/src/app/db/migrations/meta/0055_snapshot.json +++ b/src/app/db/migrations/meta/0055_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "e1d66f84-edde-4bc5-b1f6-0dd7913a4223", - "prevId": "b92e97d1-c6e9-4749-b205-ad3cf5470a4d", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -711,33 +725,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -786,9 +804,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -849,9 +871,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -898,33 +924,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -965,33 +995,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1019,33 +1053,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1164,20 +1202,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1236,33 +1278,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1313,125 +1359,140 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1439,5 +1500,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "e1d66f84-edde-4bc5-b1f6-0dd7913a4223", + "prevId": "b92e97d1-c6e9-4749-b205-ad3cf5470a4d", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0056_snapshot.json b/src/app/db/migrations/meta/0056_snapshot.json index fd39abf..53a6942 100644 --- a/src/app/db/migrations/meta/0056_snapshot.json +++ b/src/app/db/migrations/meta/0056_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "02ba8ca7-ce79-4ba9-8137-02e9370db78f", - "prevId": "e1d66f84-edde-4bc5-b1f6-0dd7913a4223", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -711,33 +725,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -786,9 +804,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -849,9 +871,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -898,33 +924,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -965,33 +995,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1019,33 +1053,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1164,20 +1202,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1236,33 +1278,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1313,128 +1359,143 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterpoofing": "flat_roof_waterpoofing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterpoofing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1442,5 +1503,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "02ba8ca7-ce79-4ba9-8137-02e9370db78f", + "prevId": "e1d66f84-edde-4bc5-b1f6-0dd7913a4223", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0057_snapshot.json b/src/app/db/migrations/meta/0057_snapshot.json index 7f737e2..1dc66a3 100644 --- a/src/app/db/migrations/meta/0057_snapshot.json +++ b/src/app/db/migrations/meta/0057_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "129aadb7-4236-43d5-b515-3ff519d1212e", - "prevId": "02ba8ca7-ce79-4ba9-8137-02e9370db78f", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -711,33 +725,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -786,9 +804,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -849,9 +871,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -898,33 +924,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -965,33 +995,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1019,33 +1053,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1164,20 +1202,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1236,33 +1278,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1313,128 +1359,143 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1442,5 +1503,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "129aadb7-4236-43d5-b515-3ff519d1212e", + "prevId": "02ba8ca7-ce79-4ba9-8137-02e9370db78f", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0058_snapshot.json b/src/app/db/migrations/meta/0058_snapshot.json index aadd210..dd23b18 100644 --- a/src/app/db/migrations/meta/0058_snapshot.json +++ b/src/app/db/migrations/meta/0058_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "4e0e60f7-163f-4a1d-b2e3-6d146e5edbd4", - "prevId": "129aadb7-4236-43d5-b515-3ff519d1212e", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -711,33 +725,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -786,9 +804,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -849,9 +871,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -898,33 +924,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -965,33 +995,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1019,33 +1053,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1164,20 +1202,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1236,33 +1278,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1313,129 +1359,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1443,5 +1504,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "4e0e60f7-163f-4a1d-b2e3-6d146e5edbd4", + "prevId": "129aadb7-4236-43d5-b515-3ff519d1212e", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0059_snapshot.json b/src/app/db/migrations/meta/0059_snapshot.json index 0e46512..05cb3b2 100644 --- a/src/app/db/migrations/meta/0059_snapshot.json +++ b/src/app/db/migrations/meta/0059_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "17e008c7-4149-472f-b196-2589ca178aaf", - "prevId": "4e0e60f7-163f-4a1d-b2e3-6d146e5edbd4", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -718,33 +732,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -793,9 +811,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -856,9 +878,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -905,33 +931,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -972,33 +1002,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1026,33 +1060,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1171,20 +1209,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1243,33 +1285,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1320,129 +1366,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1450,5 +1511,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "17e008c7-4149-472f-b196-2589ca178aaf", + "prevId": "4e0e60f7-163f-4a1d-b2e3-6d146e5edbd4", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0060_snapshot.json b/src/app/db/migrations/meta/0060_snapshot.json index c085439..98ab548 100644 --- a/src/app/db/migrations/meta/0060_snapshot.json +++ b/src/app/db/migrations/meta/0060_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "3c817f71-e62b-47f7-b4ba-bfa29db01679", - "prevId": "17e008c7-4149-472f-b196-2589ca178aaf", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -460,20 +470,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -718,33 +732,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -793,9 +811,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -856,9 +878,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -905,33 +931,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -972,33 +1002,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1026,33 +1060,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1177,20 +1215,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1249,33 +1291,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1326,129 +1372,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1456,5 +1517,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "3c817f71-e62b-47f7-b4ba-bfa29db01679", + "prevId": "17e008c7-4149-472f-b196-2589ca178aaf", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0061_snapshot.json b/src/app/db/migrations/meta/0061_snapshot.json index 768ac9b..19c5fed 100644 --- a/src/app/db/migrations/meta/0061_snapshot.json +++ b/src/app/db/migrations/meta/0061_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "1caebf48-3295-417e-8867-a2d95a4141bd", - "prevId": "3c817f71-e62b-47f7-b4ba-bfa29db01679", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -466,20 +476,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -724,33 +738,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -799,9 +817,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -862,9 +884,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -911,33 +937,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -978,33 +1008,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1032,33 +1066,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1183,20 +1221,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1255,33 +1297,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1332,129 +1378,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1462,5 +1523,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "1caebf48-3295-417e-8867-a2d95a4141bd", + "prevId": "3c817f71-e62b-47f7-b4ba-bfa29db01679", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0062_snapshot.json b/src/app/db/migrations/meta/0062_snapshot.json index 6f5a315..a319c15 100644 --- a/src/app/db/migrations/meta/0062_snapshot.json +++ b/src/app/db/migrations/meta/0062_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "31a6356d-9288-4551-909d-9a3f3e1456d2", - "prevId": "1caebf48-3295-417e-8867-a2d95a4141bd", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -466,20 +476,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -724,33 +738,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -799,9 +817,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -862,9 +884,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -911,33 +937,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -996,33 +1026,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1050,33 +1084,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1201,20 +1239,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1273,33 +1315,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1350,129 +1396,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1480,5 +1541,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "31a6356d-9288-4551-909d-9a3f3e1456d2", + "prevId": "1caebf48-3295-417e-8867-a2d95a4141bd", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0063_snapshot.json b/src/app/db/migrations/meta/0063_snapshot.json index d3f2ba1..1772f17 100644 --- a/src/app/db/migrations/meta/0063_snapshot.json +++ b/src/app/db/migrations/meta/0063_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "74e4c2aa-5168-4b30-b3d2-26c14db5c55d", - "prevId": "31a6356d-9288-4551-909d-9a3f3e1456d2", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -353,9 +363,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -389,20 +403,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -546,20 +564,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -804,33 +826,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -879,9 +905,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -942,9 +972,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -991,33 +1025,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1076,33 +1114,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1130,33 +1172,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1288,20 +1334,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1360,33 +1410,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1437,129 +1491,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1567,5 +1636,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "74e4c2aa-5168-4b30-b3d2-26c14db5c55d", + "prevId": "31a6356d-9288-4551-909d-9a3f3e1456d2", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0064_snapshot.json b/src/app/db/migrations/meta/0064_snapshot.json index cc2c5b2..e65ec10 100644 --- a/src/app/db/migrations/meta/0064_snapshot.json +++ b/src/app/db/migrations/meta/0064_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "7fabbe90-96be-4942-8104-3878428e4a68", - "prevId": "74e4c2aa-5168-4b30-b3d2-26c14db5c55d", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -353,9 +363,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -389,20 +403,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -546,20 +564,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -804,33 +826,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -879,9 +905,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -942,9 +972,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -991,33 +1025,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1076,33 +1114,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1130,33 +1172,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1288,20 +1334,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1360,33 +1410,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1437,129 +1491,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1567,5 +1636,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "7fabbe90-96be-4942-8104-3878428e4a68", + "prevId": "74e4c2aa-5168-4b30-b3d2-26c14db5c55d", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0065_snapshot.json b/src/app/db/migrations/meta/0065_snapshot.json index 759772b..42c173a 100644 --- a/src/app/db/migrations/meta/0065_snapshot.json +++ b/src/app/db/migrations/meta/0065_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "24fca74b-a551-474c-8cc2-b33d43aa5d54", - "prevId": "7fabbe90-96be-4942-8104-3878428e4a68", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -353,9 +363,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -389,20 +403,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -546,20 +564,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -804,33 +826,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -879,9 +905,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -942,9 +972,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -991,33 +1025,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1076,33 +1114,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1130,33 +1172,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1288,20 +1334,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1360,33 +1410,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1437,129 +1491,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1567,5 +1636,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "24fca74b-a551-474c-8cc2-b33d43aa5d54", + "prevId": "7fabbe90-96be-4942-8104-3878428e4a68", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0066_snapshot.json b/src/app/db/migrations/meta/0066_snapshot.json index 556b374..614799c 100644 --- a/src/app/db/migrations/meta/0066_snapshot.json +++ b/src/app/db/migrations/meta/0066_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "a73e24ac-3dca-4735-a505-18393963157f", - "prevId": "24fca74b-a551-474c-8cc2-b33d43aa5d54", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -246,9 +248,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -296,33 +302,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -353,9 +363,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -389,20 +403,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -546,20 +564,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -804,33 +826,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -879,9 +905,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -942,9 +972,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -991,33 +1025,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1076,33 +1114,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1130,33 +1172,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1288,20 +1334,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1360,33 +1410,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1437,129 +1491,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1567,5 +1636,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "a73e24ac-3dca-4735-a505-18393963157f", + "prevId": "24fca74b-a551-474c-8cc2-b33d43aa5d54", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0067_snapshot.json b/src/app/db/migrations/meta/0067_snapshot.json index c11a708..7ed7b47 100644 --- a/src/app/db/migrations/meta/0067_snapshot.json +++ b/src/app/db/migrations/meta/0067_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "8ef0d0a9-1e8f-4a0f-8fbb-75b051b9ec66", - "prevId": "a73e24ac-3dca-4735-a505-18393963157f", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -324,9 +326,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -374,33 +380,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -431,9 +441,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -467,20 +481,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -624,20 +642,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -882,33 +904,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -957,9 +983,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1020,9 +1050,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1069,33 +1103,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1154,33 +1192,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1208,33 +1250,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1366,20 +1412,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1438,33 +1488,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1515,129 +1569,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1645,5 +1714,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "8ef0d0a9-1e8f-4a0f-8fbb-75b051b9ec66", + "prevId": "a73e24ac-3dca-4735-a505-18393963157f", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0068_snapshot.json b/src/app/db/migrations/meta/0068_snapshot.json index eca59b8..7b3308f 100644 --- a/src/app/db/migrations/meta/0068_snapshot.json +++ b/src/app/db/migrations/meta/0068_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "d76cd108-d036-4c27-98a7-8308a81f6ea6", - "prevId": "8ef0d0a9-1e8f-4a0f-8fbb-75b051b9ec66", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -139,9 +137,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -330,9 +332,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -380,33 +386,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -437,9 +447,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -473,20 +487,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -630,20 +648,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -888,33 +910,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -963,9 +989,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1026,9 +1056,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1075,33 +1109,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1160,33 +1198,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1214,33 +1256,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1372,20 +1418,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1444,33 +1494,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1521,129 +1575,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1651,5 +1720,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "d76cd108-d036-4c27-98a7-8308a81f6ea6", + "prevId": "8ef0d0a9-1e8f-4a0f-8fbb-75b051b9ec66", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0069_snapshot.json b/src/app/db/migrations/meta/0069_snapshot.json index 5748e7b..35a4d7f 100644 --- a/src/app/db/migrations/meta/0069_snapshot.json +++ b/src/app/db/migrations/meta/0069_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "1c9ffd3c-9a0f-43f4-aad3-255a7a2db567", - "prevId": "d76cd108-d036-4c27-98a7-8308a81f6ea6", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -146,9 +144,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -337,9 +339,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -387,33 +393,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -444,9 +454,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -480,20 +494,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -637,20 +655,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -895,33 +917,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -970,9 +996,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1033,9 +1063,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1082,33 +1116,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1167,33 +1205,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1221,33 +1263,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1379,20 +1425,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1451,33 +1501,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1528,129 +1582,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1658,5 +1727,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "1c9ffd3c-9a0f-43f4-aad3-255a7a2db567", + "prevId": "d76cd108-d036-4c27-98a7-8308a81f6ea6", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0070_snapshot.json b/src/app/db/migrations/meta/0070_snapshot.json index 9974a33..61e72a9 100644 --- a/src/app/db/migrations/meta/0070_snapshot.json +++ b/src/app/db/migrations/meta/0070_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "9dcff065-aaef-4c74-b734-3b9dfd8aed34", - "prevId": "1c9ffd3c-9a0f-43f4-aad3-255a7a2db567", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -146,9 +144,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -337,9 +339,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -387,33 +393,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -444,9 +454,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -480,20 +494,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -637,20 +655,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -895,33 +917,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -970,9 +996,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1033,9 +1063,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1082,33 +1116,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1167,33 +1205,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1221,33 +1263,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1379,20 +1425,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1451,33 +1501,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1528,129 +1582,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1660,5 +1729,11 @@ "columns": { "\"recommendation\".\"adjusted_heat_demand\"": "\"recommendation\".\"kwh_savings\"" } - } + }, + "id": "9dcff065-aaef-4c74-b734-3b9dfd8aed34", + "prevId": "1c9ffd3c-9a0f-43f4-aad3-255a7a2db567", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0071_snapshot.json b/src/app/db/migrations/meta/0071_snapshot.json index 838ea30..378e6f2 100644 --- a/src/app/db/migrations/meta/0071_snapshot.json +++ b/src/app/db/migrations/meta/0071_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "a6f66255-7a69-40e2-80a9-e518a2a32acc", - "prevId": "9dcff065-aaef-4c74-b734-3b9dfd8aed34", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -146,9 +144,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -337,9 +339,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -387,33 +393,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -444,9 +454,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -480,20 +494,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -637,20 +655,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -895,33 +917,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -970,9 +996,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1033,9 +1063,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1082,33 +1116,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1167,33 +1205,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1221,33 +1263,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1379,20 +1425,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1451,33 +1501,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -1528,9 +1582,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1581,129 +1639,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1711,5 +1784,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "a6f66255-7a69-40e2-80a9-e518a2a32acc", + "prevId": "9dcff065-aaef-4c74-b734-3b9dfd8aed34", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0072_snapshot.json b/src/app/db/migrations/meta/0072_snapshot.json index 9627d05..d24651d 100644 --- a/src/app/db/migrations/meta/0072_snapshot.json +++ b/src/app/db/migrations/meta/0072_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "b0647d5d-f190-409f-92fc-5cefc8777e01", - "prevId": "a6f66255-7a69-40e2-80a9-e518a2a32acc", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -146,9 +144,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -337,9 +339,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -387,33 +393,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -444,9 +454,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -480,20 +494,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -637,20 +655,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -895,33 +917,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -970,9 +996,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1033,9 +1063,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1082,33 +1116,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1167,33 +1205,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1221,33 +1263,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1379,20 +1425,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1451,33 +1501,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -1528,9 +1582,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1581,129 +1639,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1713,5 +1786,11 @@ "columns": { "\"solar\".\"api_response\"": "\"solar\".\"google_api_response\"" } - } + }, + "id": "b0647d5d-f190-409f-92fc-5cefc8777e01", + "prevId": "a6f66255-7a69-40e2-80a9-e518a2a32acc", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0073_snapshot.json b/src/app/db/migrations/meta/0073_snapshot.json index 084b824..25e920a 100644 --- a/src/app/db/migrations/meta/0073_snapshot.json +++ b/src/app/db/migrations/meta/0073_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "682cea05-66fd-4503-8de8-0182e00a09ca", - "prevId": "b0647d5d-f190-409f-92fc-5cefc8777e01", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -146,9 +144,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -337,9 +339,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -387,33 +393,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -444,9 +454,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -480,20 +494,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -637,20 +655,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -895,33 +917,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -970,9 +996,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1033,9 +1063,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1082,33 +1116,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1167,33 +1205,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1221,33 +1263,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1379,20 +1425,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1451,33 +1501,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -1528,9 +1582,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1581,129 +1639,144 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] } }, "schemas": {}, @@ -1711,5 +1784,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "682cea05-66fd-4503-8de8-0182e00a09ca", + "prevId": "b0647d5d-f190-409f-92fc-5cefc8777e01", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0074_snapshot.json b/src/app/db/migrations/meta/0074_snapshot.json index 70d7d7a..cbfb18e 100644 --- a/src/app/db/migrations/meta/0074_snapshot.json +++ b/src/app/db/migrations/meta/0074_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "0c266460-e12c-4bea-8e72-0d8a98ffa1ff", - "prevId": "682cea05-66fd-4503-8de8-0182e00a09ca", + "version": "7", + "dialect": "postgresql", "tables": { - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -146,9 +144,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -337,9 +339,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -387,33 +393,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -444,9 +454,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -480,20 +494,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -637,20 +655,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -895,33 +917,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -970,9 +996,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1033,9 +1063,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1082,33 +1116,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1167,33 +1205,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1221,33 +1263,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -1379,20 +1425,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -1451,33 +1501,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -1528,9 +1582,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -1618,20 +1676,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -1682,136 +1744,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -1819,5 +1897,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "0c266460-e12c-4bea-8e72-0d8a98ffa1ff", + "prevId": "682cea05-66fd-4503-8de8-0182e00a09ca", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0075_snapshot.json b/src/app/db/migrations/meta/0075_snapshot.json index 2d35093..6670fa2 100644 --- a/src/app/db/migrations/meta/0075_snapshot.json +++ b/src/app/db/migrations/meta/0075_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "eb572978-d32a-4f2a-af8f-8533b196e650", - "prevId": "0c266460-e12c-4bea-8e72-0d8a98ffa1ff", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -689,9 +687,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -833,9 +835,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1024,9 +1030,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1074,33 +1084,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1131,9 +1145,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1167,20 +1185,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1324,20 +1346,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1582,33 +1608,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1657,9 +1687,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1720,9 +1754,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1769,33 +1807,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1854,33 +1896,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1908,33 +1954,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2066,20 +2116,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2138,33 +2192,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2215,9 +2273,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2305,20 +2367,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2369,136 +2435,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2506,5 +2588,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "eb572978-d32a-4f2a-af8f-8533b196e650", + "prevId": "0c266460-e12c-4bea-8e72-0d8a98ffa1ff", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0076_snapshot.json b/src/app/db/migrations/meta/0076_snapshot.json index 9b0558d..2717c31 100644 --- a/src/app/db/migrations/meta/0076_snapshot.json +++ b/src/app/db/migrations/meta/0076_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "7ec87c11-30ae-481e-9dbc-224ee23e4e65", - "prevId": "eb572978-d32a-4f2a-af8f-8533b196e650", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -689,9 +687,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -833,9 +835,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1024,9 +1030,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1074,33 +1084,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1131,9 +1145,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1167,20 +1185,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1324,20 +1346,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1582,33 +1608,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1657,9 +1687,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1720,9 +1754,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1769,33 +1807,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1854,33 +1896,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1908,33 +1954,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2066,20 +2116,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2138,33 +2192,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2215,9 +2273,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2305,20 +2367,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2369,136 +2435,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2508,5 +2590,11 @@ "columns": { "\"energy_assessments\".\"environmentImpactPotential\"": "\"energy_assessments\".\"environment_impact_potential\"" } - } + }, + "id": "7ec87c11-30ae-481e-9dbc-224ee23e4e65", + "prevId": "eb572978-d32a-4f2a-af8f-8533b196e650", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0077_snapshot.json b/src/app/db/migrations/meta/0077_snapshot.json index a247ad9..c07e3af 100644 --- a/src/app/db/migrations/meta/0077_snapshot.json +++ b/src/app/db/migrations/meta/0077_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "fd14ba60-af2b-4124-8847-9aa8fcf6f3ca", - "prevId": "7ec87c11-30ae-481e-9dbc-224ee23e4e65", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -689,9 +687,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -833,9 +835,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1024,9 +1030,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1074,33 +1084,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1131,9 +1145,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1167,20 +1185,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1324,20 +1346,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1582,33 +1608,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1657,9 +1687,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1720,9 +1754,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1769,33 +1807,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1854,33 +1896,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1908,33 +1954,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2066,20 +2116,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2138,33 +2192,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2215,9 +2273,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2305,20 +2367,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2369,136 +2435,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2506,5 +2588,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "fd14ba60-af2b-4124-8847-9aa8fcf6f3ca", + "prevId": "7ec87c11-30ae-481e-9dbc-224ee23e4e65", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0078_snapshot.json b/src/app/db/migrations/meta/0078_snapshot.json index 9cc758e..bbb0769 100644 --- a/src/app/db/migrations/meta/0078_snapshot.json +++ b/src/app/db/migrations/meta/0078_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "09c0ee11-6902-4b6a-bad7-b81335a43dbc", - "prevId": "fd14ba60-af2b-4124-8847-9aa8fcf6f3ca", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -695,9 +693,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -839,9 +841,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1030,9 +1036,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1080,33 +1090,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1137,9 +1151,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1173,20 +1191,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1330,20 +1352,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1588,33 +1614,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1663,9 +1693,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1726,9 +1760,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1775,33 +1813,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1860,33 +1902,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1914,33 +1960,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2072,20 +2122,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2144,33 +2198,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2221,9 +2279,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2311,20 +2373,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2375,136 +2441,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2512,5 +2594,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "09c0ee11-6902-4b6a-bad7-b81335a43dbc", + "prevId": "fd14ba60-af2b-4124-8847-9aa8fcf6f3ca", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0079_snapshot.json b/src/app/db/migrations/meta/0079_snapshot.json index a87cd5e..3b5404f 100644 --- a/src/app/db/migrations/meta/0079_snapshot.json +++ b/src/app/db/migrations/meta/0079_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "86544e1f-869d-4715-a687-0bff4bb8fbce", - "prevId": "09c0ee11-6902-4b6a-bad7-b81335a43dbc", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1872,33 +1914,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1926,33 +1972,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2084,20 +2134,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2156,33 +2210,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2233,9 +2291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2323,20 +2385,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2387,136 +2453,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2524,5 +2606,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "86544e1f-869d-4715-a687-0bff4bb8fbce", + "prevId": "09c0ee11-6902-4b6a-bad7-b81335a43dbc", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0080_snapshot.json b/src/app/db/migrations/meta/0080_snapshot.json index 0e58125..ca746df 100644 --- a/src/app/db/migrations/meta/0080_snapshot.json +++ b/src/app/db/migrations/meta/0080_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "49bb7e41-20f6-44c8-86b9-c122d611f174", - "prevId": "86544e1f-869d-4715-a687-0bff4bb8fbce", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1872,33 +1914,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1926,33 +1972,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2084,20 +2134,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2156,33 +2210,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2233,9 +2291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2323,20 +2385,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2387,136 +2453,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2524,5 +2606,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "49bb7e41-20f6-44c8-86b9-c122d611f174", + "prevId": "86544e1f-869d-4715-a687-0bff4bb8fbce", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0081_snapshot.json b/src/app/db/migrations/meta/0081_snapshot.json index 8972258..ac8c828 100644 --- a/src/app/db/migrations/meta/0081_snapshot.json +++ b/src/app/db/migrations/meta/0081_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "3925ae6e-dc0c-4c1e-ac53-885725e8edf0", - "prevId": "49bb7e41-20f6-44c8-86b9-c122d611f174", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1878,33 +1920,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1932,33 +1978,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2090,20 +2140,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2162,33 +2216,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2239,9 +2297,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2329,20 +2391,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2393,136 +2459,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2530,5 +2612,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "3925ae6e-dc0c-4c1e-ac53-885725e8edf0", + "prevId": "49bb7e41-20f6-44c8-86b9-c122d611f174", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0082_snapshot.json b/src/app/db/migrations/meta/0082_snapshot.json index e8fb250..43e5630 100644 --- a/src/app/db/migrations/meta/0082_snapshot.json +++ b/src/app/db/migrations/meta/0082_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "3cee70ea-b111-4aae-96dd-aea660944ae2", - "prevId": "3925ae6e-dc0c-4c1e-ac53-885725e8edf0", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1998,33 +2040,37 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2052,33 +2098,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2210,20 +2260,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2282,33 +2336,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2359,9 +2417,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2449,20 +2511,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2513,136 +2579,152 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2650,5 +2732,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "3cee70ea-b111-4aae-96dd-aea660944ae2", + "prevId": "3925ae6e-dc0c-4c1e-ac53-885725e8edf0", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0083_snapshot.json b/src/app/db/migrations/meta/0083_snapshot.json index d097992..24242c3 100644 --- a/src/app/db/migrations/meta/0083_snapshot.json +++ b/src/app/db/migrations/meta/0083_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "945b149b-bc7e-4b70-8a96-20fb904ded55", - "prevId": "3cee70ea-b111-4aae-96dd-aea660944ae2", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2004,46 +2046,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2071,33 +2117,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2229,20 +2279,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2301,33 +2355,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2416,20 +2474,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2480,9 +2542,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2570,20 +2636,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2634,143 +2704,160 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2778,5 +2865,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "945b149b-bc7e-4b70-8a96-20fb904ded55", + "prevId": "3cee70ea-b111-4aae-96dd-aea660944ae2", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0084_snapshot.json b/src/app/db/migrations/meta/0084_snapshot.json index 6dfb08c..2d6bbb1 100644 --- a/src/app/db/migrations/meta/0084_snapshot.json +++ b/src/app/db/migrations/meta/0084_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "7fcdce6e-f23e-4256-9e3f-4d923c9e2bbf", - "prevId": "945b149b-bc7e-4b70-8a96-20fb904ded55", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1884,46 +1926,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1951,33 +1997,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2109,20 +2159,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2181,33 +2235,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2296,20 +2354,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2360,9 +2422,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2450,20 +2516,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2514,143 +2584,160 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2658,5 +2745,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "7fcdce6e-f23e-4256-9e3f-4d923c9e2bbf", + "prevId": "945b149b-bc7e-4b70-8a96-20fb904ded55", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0085_snapshot.json b/src/app/db/migrations/meta/0085_snapshot.json index 7e65510..c28a6e1 100644 --- a/src/app/db/migrations/meta/0085_snapshot.json +++ b/src/app/db/migrations/meta/0085_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "70c15e17-b9e7-4faa-acb3-2fb921433184", - "prevId": "7fcdce6e-f23e-4256-9e3f-4d923c9e2bbf", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1884,46 +1926,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1951,33 +1997,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2109,20 +2159,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2181,33 +2235,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2416,20 +2474,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2480,9 +2542,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2570,20 +2636,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2634,143 +2704,160 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2778,5 +2865,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "70c15e17-b9e7-4faa-acb3-2fb921433184", + "prevId": "7fcdce6e-f23e-4256-9e3f-4d923c9e2bbf", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0086_snapshot.json b/src/app/db/migrations/meta/0086_snapshot.json index 2aa0f48..f2c5d46 100644 --- a/src/app/db/migrations/meta/0086_snapshot.json +++ b/src/app/db/migrations/meta/0086_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "4892f69c-0b16-46c5-ae83-17b133aa6cac", - "prevId": "70c15e17-b9e7-4faa-acb3-2fb921433184", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1884,46 +1926,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1951,33 +1997,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2109,20 +2159,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2181,33 +2235,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2422,20 +2480,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2486,9 +2548,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2576,20 +2642,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2640,143 +2710,160 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2784,5 +2871,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "4892f69c-0b16-46c5-ae83-17b133aa6cac", + "prevId": "70c15e17-b9e7-4faa-acb3-2fb921433184", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0087_snapshot.json b/src/app/db/migrations/meta/0087_snapshot.json index f829efa..6deaac3 100644 --- a/src/app/db/migrations/meta/0087_snapshot.json +++ b/src/app/db/migrations/meta/0087_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "b98e069f-0e13-4eda-b466-04460a6eb551", - "prevId": "4892f69c-0b16-46c5-ae83-17b133aa6cac", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1884,46 +1926,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1951,33 +1997,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2109,20 +2159,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2181,33 +2235,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2422,20 +2480,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2486,9 +2548,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2576,20 +2642,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2640,143 +2710,160 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2784,5 +2871,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "b98e069f-0e13-4eda-b466-04460a6eb551", + "prevId": "4892f69c-0b16-46c5-ae83-17b133aa6cac", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0088_snapshot.json b/src/app/db/migrations/meta/0088_snapshot.json index aec3a0a..a1a36b8 100644 --- a/src/app/db/migrations/meta/0088_snapshot.json +++ b/src/app/db/migrations/meta/0088_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "d5967b0e-54fa-427b-b755-8fde114c550e", - "prevId": "b98e069f-0e13-4eda-b466-04460a6eb551", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1884,46 +1926,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1951,33 +1997,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2109,20 +2159,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2181,33 +2235,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2434,20 +2492,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2498,9 +2560,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2588,20 +2654,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2652,143 +2722,160 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2796,5 +2883,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "d5967b0e-54fa-427b-b755-8fde114c550e", + "prevId": "b98e069f-0e13-4eda-b466-04460a6eb551", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0089_snapshot.json b/src/app/db/migrations/meta/0089_snapshot.json index 689aae3..66ac2c6 100644 --- a/src/app/db/migrations/meta/0089_snapshot.json +++ b/src/app/db/migrations/meta/0089_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "08cbcf5d-331d-4e76-b717-91aa7084187a", - "prevId": "d5967b0e-54fa-427b-b755-8fde114c550e", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1600,33 +1626,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1675,9 +1705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1738,9 +1772,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1787,33 +1825,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1884,46 +1926,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1951,33 +1997,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2109,20 +2159,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2181,33 +2235,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2434,20 +2492,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2498,9 +2560,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2588,20 +2654,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2652,143 +2722,160 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2798,5 +2885,11 @@ "columns": { "\"property_details_epc\".\"adjusted_energy_consumption\"": "\"property_details_epc\".\"current_energy_demand\"" } - } + }, + "id": "08cbcf5d-331d-4e76-b717-91aa7084187a", + "prevId": "d5967b0e-54fa-427b-b755-8fde114c550e", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0090_snapshot.json b/src/app/db/migrations/meta/0090_snapshot.json index 36d2ab2..5e20933 100644 --- a/src/app/db/migrations/meta/0090_snapshot.json +++ b/src/app/db/migrations/meta/0090_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "e0184a2b-bdf4-4b98-912b-3552c1b0bfdf", - "prevId": "08cbcf5d-331d-4e76-b717-91aa7084187a", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -851,9 +853,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1042,9 +1048,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1092,33 +1102,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1149,9 +1163,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1185,20 +1203,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1342,20 +1364,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1606,33 +1632,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1681,9 +1711,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1744,9 +1778,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1793,33 +1831,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1890,46 +1932,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -1957,33 +2003,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2115,20 +2165,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2187,33 +2241,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2440,20 +2498,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2504,9 +2566,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2594,20 +2660,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2658,143 +2728,160 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2802,5 +2889,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "e0184a2b-bdf4-4b98-912b-3552c1b0bfdf", + "prevId": "08cbcf5d-331d-4e76-b717-91aa7084187a", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0091_snapshot.json b/src/app/db/migrations/meta/0091_snapshot.json index 3cf229d..d2f127a 100644 --- a/src/app/db/migrations/meta/0091_snapshot.json +++ b/src/app/db/migrations/meta/0091_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "3a7b02f9-a2f8-4de8-806a-89afd570886a", - "prevId": "e0184a2b-bdf4-4b98-912b-3552c1b0bfdf", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -753,9 +755,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -897,9 +903,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1088,9 +1098,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1138,33 +1152,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1195,9 +1213,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1231,20 +1253,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1388,20 +1414,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1652,33 +1682,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1727,9 +1761,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1790,9 +1828,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1839,33 +1881,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1936,46 +1982,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2003,33 +2053,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2161,20 +2215,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2233,33 +2291,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2486,20 +2548,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2550,9 +2616,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2640,20 +2710,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2704,154 +2778,172 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario EPR": "Scenario EPR" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario EPR" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2859,5 +2951,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "3a7b02f9-a2f8-4de8-806a-89afd570886a", + "prevId": "e0184a2b-bdf4-4b98-912b-3552c1b0bfdf", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0092_snapshot.json b/src/app/db/migrations/meta/0092_snapshot.json index 501cb0a..2950fe1 100644 --- a/src/app/db/migrations/meta/0092_snapshot.json +++ b/src/app/db/migrations/meta/0092_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "d3a68e11-0ef8-48ce-8726-021ab9060715", - "prevId": "3a7b02f9-a2f8-4de8-806a-89afd570886a", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -753,9 +755,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -897,9 +903,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1088,9 +1098,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1138,33 +1152,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1195,9 +1213,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1231,20 +1253,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1388,20 +1414,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1652,33 +1682,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1727,9 +1761,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1790,9 +1828,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1839,33 +1881,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1936,46 +1982,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2003,33 +2053,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2161,20 +2215,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2233,33 +2291,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2486,20 +2548,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2550,9 +2616,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2640,20 +2710,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2704,154 +2778,172 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2859,5 +2951,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "d3a68e11-0ef8-48ce-8726-021ab9060715", + "prevId": "3a7b02f9-a2f8-4de8-806a-89afd570886a", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0093_snapshot.json b/src/app/db/migrations/meta/0093_snapshot.json index d45efdc..75d805a 100644 --- a/src/app/db/migrations/meta/0093_snapshot.json +++ b/src/app/db/migrations/meta/0093_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "7b4b3557-a243-4c59-a49b-b7a0407f7759", - "prevId": "d3a68e11-0ef8-48ce-8726-021ab9060715", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -753,9 +755,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -897,9 +903,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1088,9 +1098,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1138,33 +1152,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1195,9 +1213,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1231,20 +1253,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1388,20 +1414,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1652,33 +1682,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1727,9 +1761,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1790,9 +1828,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1839,33 +1881,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -1936,46 +1982,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2003,33 +2053,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2161,20 +2215,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2233,33 +2291,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2486,20 +2548,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2550,9 +2616,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2640,20 +2710,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2704,155 +2778,173 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2860,5 +2952,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "7b4b3557-a243-4c59-a49b-b7a0407f7759", + "prevId": "d3a68e11-0ef8-48ce-8726-021ab9060715", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0094_snapshot.json b/src/app/db/migrations/meta/0094_snapshot.json index 022ae87..7635dfe 100644 --- a/src/app/db/migrations/meta/0094_snapshot.json +++ b/src/app/db/migrations/meta/0094_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "ffd33541-3448-4213-bdd4-7edd21177ac1", - "prevId": "7b4b3557-a243-4c59-a49b-b7a0407f7759", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -762,33 +764,37 @@ "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "energy_assessment_documents_scenario_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_scenario_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "scenario_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_scenarios": { + "public.energy_assessment_scenarios": { "name": "energy_assessment_scenarios", "schema": "", "columns": { @@ -816,20 +822,24 @@ "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_scenarios", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -971,9 +981,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1162,9 +1176,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1212,33 +1230,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1269,9 +1291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1305,20 +1331,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1462,20 +1492,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1726,33 +1760,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1801,9 +1839,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1864,9 +1906,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1913,33 +1959,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2010,46 +2060,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2077,33 +2131,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2235,20 +2293,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2307,33 +2369,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2560,20 +2626,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2624,9 +2694,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2714,20 +2788,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2778,155 +2856,173 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2934,5 +3030,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "ffd33541-3448-4213-bdd4-7edd21177ac1", + "prevId": "7b4b3557-a243-4c59-a49b-b7a0407f7759", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0095_snapshot.json b/src/app/db/migrations/meta/0095_snapshot.json index 7ef5617..9bfd0bf 100644 --- a/src/app/db/migrations/meta/0095_snapshot.json +++ b/src/app/db/migrations/meta/0095_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "9466abc6-4c85-4936-8b79-69ebe1ad8753", - "prevId": "ffd33541-3448-4213-bdd4-7edd21177ac1", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -762,33 +764,37 @@ "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessment_scenarios", "columnsFrom": [ "scenario_id" ], + "tableTo": "energy_assessment_scenarios", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_scenarios": { + "public.energy_assessment_scenarios": { "name": "energy_assessment_scenarios", "schema": "", "columns": { @@ -816,20 +822,24 @@ "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_scenarios", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -971,9 +981,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1162,9 +1176,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1212,33 +1230,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1269,9 +1291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1305,20 +1331,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1462,20 +1492,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1726,33 +1760,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1801,9 +1839,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1864,9 +1906,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1913,33 +1959,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2010,46 +2060,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2077,33 +2131,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2235,20 +2293,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2307,33 +2369,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2560,20 +2626,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2624,9 +2694,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2714,20 +2788,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2778,155 +2856,173 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2934,5 +3030,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "9466abc6-4c85-4936-8b79-69ebe1ad8753", + "prevId": "ffd33541-3448-4213-bdd4-7edd21177ac1", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0096_snapshot.json b/src/app/db/migrations/meta/0096_snapshot.json index aa2d4df..2a44b28 100644 --- a/src/app/db/migrations/meta/0096_snapshot.json +++ b/src/app/db/migrations/meta/0096_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "3a1cf4ff-f281-43fd-bd26-76684746ac05", - "prevId": "9466abc6-4c85-4936-8b79-69ebe1ad8753", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -762,33 +764,37 @@ "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessment_scenarios", "columnsFrom": [ "scenario_id" ], + "tableTo": "energy_assessment_scenarios", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_scenarios": { + "public.energy_assessment_scenarios": { "name": "energy_assessment_scenarios", "schema": "", "columns": { @@ -816,20 +822,24 @@ "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_scenarios", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -971,9 +981,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1162,9 +1176,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1212,33 +1230,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1269,9 +1291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1305,20 +1331,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1462,20 +1492,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1726,33 +1760,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1801,9 +1839,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1864,9 +1906,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1913,33 +1959,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2010,46 +2060,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2077,33 +2131,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2235,20 +2293,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2307,33 +2369,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2560,20 +2626,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2624,9 +2694,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2714,20 +2788,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2778,156 +2856,174 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "survey": "survey", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2935,5 +3031,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "3a1cf4ff-f281-43fd-bd26-76684746ac05", + "prevId": "9466abc6-4c85-4936-8b79-69ebe1ad8753", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0097_snapshot.json b/src/app/db/migrations/meta/0097_snapshot.json index 3526c3c..3bea8c3 100644 --- a/src/app/db/migrations/meta/0097_snapshot.json +++ b/src/app/db/migrations/meta/0097_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "84ffc8ed-87c2-4764-bada-6c9ec5a0af77", - "prevId": "3a1cf4ff-f281-43fd-bd26-76684746ac05", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -762,33 +764,37 @@ "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessment_scenarios", "columnsFrom": [ "scenario_id" ], + "tableTo": "energy_assessment_scenarios", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_scenarios": { + "public.energy_assessment_scenarios": { "name": "energy_assessment_scenarios", "schema": "", "columns": { @@ -816,20 +822,24 @@ "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_scenarios", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -971,9 +981,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1162,9 +1176,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1212,33 +1230,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1269,9 +1291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1305,20 +1331,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1462,20 +1492,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1762,33 +1796,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1837,9 +1875,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1900,9 +1942,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1949,33 +1995,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2046,46 +2096,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2113,33 +2167,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2271,20 +2329,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2343,33 +2405,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2596,20 +2662,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2660,9 +2730,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2750,20 +2824,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2814,156 +2892,174 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "survey": "survey", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2971,5 +3067,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "84ffc8ed-87c2-4764-bada-6c9ec5a0af77", + "prevId": "3a1cf4ff-f281-43fd-bd26-76684746ac05", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0098_snapshot.json b/src/app/db/migrations/meta/0098_snapshot.json index 6771df0..760c8b5 100644 --- a/src/app/db/migrations/meta/0098_snapshot.json +++ b/src/app/db/migrations/meta/0098_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "6804906f-1dab-409e-aa95-52c4ee0c178b", - "prevId": "84ffc8ed-87c2-4764-bada-6c9ec5a0af77", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -762,33 +764,37 @@ "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessment_scenarios", "columnsFrom": [ "scenario_id" ], + "tableTo": "energy_assessment_scenarios", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_scenarios": { + "public.energy_assessment_scenarios": { "name": "energy_assessment_scenarios", "schema": "", "columns": { @@ -816,20 +822,24 @@ "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_scenarios", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -971,9 +981,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1162,9 +1176,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1212,33 +1230,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1269,9 +1291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1305,20 +1331,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1462,20 +1492,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1762,33 +1796,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1837,9 +1875,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1900,9 +1942,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1949,33 +1995,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2046,46 +2096,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2113,33 +2167,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2277,20 +2335,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2349,33 +2411,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2602,20 +2668,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2666,9 +2736,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2756,20 +2830,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2820,156 +2898,174 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "survey": "survey", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2977,5 +3073,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "6804906f-1dab-409e-aa95-52c4ee0c178b", + "prevId": "84ffc8ed-87c2-4764-bada-6c9ec5a0af77", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0099_snapshot.json b/src/app/db/migrations/meta/0099_snapshot.json index 383d069..ad5b517 100644 --- a/src/app/db/migrations/meta/0099_snapshot.json +++ b/src/app/db/migrations/meta/0099_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "48db0dd4-acc9-4535-9b99-9fd566f87a91", - "prevId": "6804906f-1dab-409e-aa95-52c4ee0c178b", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -762,33 +764,37 @@ "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessment_scenarios", "columnsFrom": [ "scenario_id" ], + "tableTo": "energy_assessment_scenarios", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_scenarios": { + "public.energy_assessment_scenarios": { "name": "energy_assessment_scenarios", "schema": "", "columns": { @@ -816,20 +822,24 @@ "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_scenarios", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -971,9 +981,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1162,9 +1176,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1212,33 +1230,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1269,9 +1291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1305,20 +1331,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1462,20 +1492,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1762,33 +1796,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1837,9 +1875,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1900,9 +1942,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1949,33 +1995,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2046,46 +2096,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2113,33 +2167,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2277,20 +2335,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2349,33 +2411,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2602,20 +2668,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2666,9 +2736,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2756,20 +2830,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2820,157 +2898,175 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "cavity_wall_extraction": "cavity_wall_extraction", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "survey": "survey", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2978,5 +3074,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "48db0dd4-acc9-4535-9b99-9fd566f87a91", + "prevId": "6804906f-1dab-409e-aa95-52c4ee0c178b", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0100_snapshot.json b/src/app/db/migrations/meta/0100_snapshot.json index 312aeb2..d4606b4 100644 --- a/src/app/db/migrations/meta/0100_snapshot.json +++ b/src/app/db/migrations/meta/0100_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "55fba457-401b-4f68-9b8a-a674b1975251", - "prevId": "48db0dd4-acc9-4535-9b99-9fd566f87a91", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -762,33 +764,37 @@ "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessment_scenarios", "columnsFrom": [ "scenario_id" ], + "tableTo": "energy_assessment_scenarios", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_scenarios": { + "public.energy_assessment_scenarios": { "name": "energy_assessment_scenarios", "schema": "", "columns": { @@ -816,20 +822,24 @@ "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_scenarios", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -971,9 +981,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1162,9 +1176,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1212,33 +1230,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1269,9 +1291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1305,20 +1331,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1462,20 +1492,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1762,33 +1796,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1837,9 +1875,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1900,9 +1942,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1949,33 +1995,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2046,46 +2096,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2113,33 +2167,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2277,20 +2335,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2349,33 +2411,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2608,20 +2674,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2672,9 +2742,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2762,20 +2836,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2826,157 +2904,175 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "cavity_wall_extraction": "cavity_wall_extraction", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "survey": "survey", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2984,5 +3080,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "55fba457-401b-4f68-9b8a-a674b1975251", + "prevId": "48db0dd4-acc9-4535-9b99-9fd566f87a91", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0101_snapshot.json b/src/app/db/migrations/meta/0101_snapshot.json index ad89845..2e9db6a 100644 --- a/src/app/db/migrations/meta/0101_snapshot.json +++ b/src/app/db/migrations/meta/0101_snapshot.json @@ -1,10 +1,8 @@ { - "version": "5", - "dialect": "pg", - "id": "09c524ee-2913-4f6e-8efc-95efa1ec9c0e", - "prevId": "55fba457-401b-4f68-9b8a-a674b1975251", + "version": "7", + "dialect": "postgresql", "tables": { - "energy_assessments": { + "public.energy_assessments": { "name": "energy_assessments", "schema": "", "columns": { @@ -707,9 +705,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_documents": { + "public.energy_assessment_documents": { "name": "energy_assessment_documents", "schema": "", "columns": { @@ -762,33 +764,37 @@ "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", "tableFrom": "energy_assessment_documents", - "tableTo": "energy_assessment_scenarios", "columnsFrom": [ "scenario_id" ], + "tableTo": "energy_assessment_scenarios", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "energy_assessment_scenarios": { + "public.energy_assessment_scenarios": { "name": "energy_assessment_scenarios", "schema": "", "columns": { @@ -816,20 +822,24 @@ "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", "tableFrom": "energy_assessment_scenarios", - "tableTo": "energy_assessments", "columnsFrom": [ "energy_assessment_id" ], + "tableTo": "energy_assessments", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "material": { + "public.material": { "name": "material", "schema": "", "columns": { @@ -971,9 +981,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolio": { + "public.portfolio": { "name": "portfolio", "schema": "", "columns": { @@ -1162,9 +1176,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "portfolioUsers": { + "public.portfolioUsers": { "name": "portfolioUsers", "schema": "", "columns": { @@ -1212,33 +1230,37 @@ "portfolioUsers_user_id_user_id_fk": { "name": "portfolioUsers_user_id_user_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "user", "columnsFrom": [ "user_id" ], + "tableTo": "user", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "portfolioUsers_portfolio_id_portfolio_id_fk": { "name": "portfolioUsers_portfolio_id_portfolio_id_fk", "tableFrom": "portfolioUsers", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey": { + "public.non_intrusive_survey": { "name": "non_intrusive_survey", "schema": "", "columns": { @@ -1269,9 +1291,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "non_intrusive_survey_notes": { + "public.non_intrusive_survey_notes": { "name": "non_intrusive_survey_notes", "schema": "", "columns": { @@ -1305,20 +1331,24 @@ "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", "tableFrom": "non_intrusive_survey_notes", - "tableTo": "non_intrusive_survey", "columnsFrom": [ "survey_id" ], + "tableTo": "non_intrusive_survey", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property": { + "public.property": { "name": "property", "schema": "", "columns": { @@ -1462,20 +1492,24 @@ "property_portfolio_id_portfolio_id_fk": { "name": "property_portfolio_id_portfolio_id_fk", "tableFrom": "property", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_epc": { + "public.property_details_epc": { "name": "property_details_epc", "schema": "", "columns": { @@ -1762,33 +1796,37 @@ "property_details_epc_property_id_property_id_fk": { "name": "property_details_epc_property_id_property_id_fk", "tableFrom": "property_details_epc", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_details_epc_portfolio_id_portfolio_id_fk": { "name": "property_details_epc_portfolio_id_portfolio_id_fk", "tableFrom": "property_details_epc", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_meter": { + "public.property_details_meter": { "name": "property_details_meter", "schema": "", "columns": { @@ -1837,9 +1875,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_details_spatial": { + "public.property_details_spatial": { "name": "property_details_spatial", "schema": "", "columns": { @@ -1900,9 +1942,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "property_targets": { + "public.property_targets": { "name": "property_targets", "schema": "", "columns": { @@ -1949,33 +1995,37 @@ "property_targets_property_id_property_id_fk": { "name": "property_targets_property_id_property_id_fk", "tableFrom": "property_targets", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "property_targets_portfolio_id_portfolio_id_fk": { "name": "property_targets_portfolio_id_portfolio_id_fk", "tableFrom": "property_targets", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan": { + "public.plan": { "name": "plan", "schema": "", "columns": { @@ -2046,46 +2096,50 @@ "plan_portfolio_id_portfolio_id_fk": { "name": "plan_portfolio_id_portfolio_id_fk", "tableFrom": "plan", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_property_id_property_id_fk": { "name": "plan_property_id_property_id_fk", "tableFrom": "plan", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_scenario_id_scenario_id_fk": { "name": "plan_scenario_id_scenario_id_fk", "tableFrom": "plan", - "tableTo": "scenario", "columnsFrom": [ "scenario_id" ], + "tableTo": "scenario", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "plan_recommendations": { + "public.plan_recommendations": { "name": "plan_recommendations", "schema": "", "columns": { @@ -2113,33 +2167,37 @@ "plan_recommendations_plan_id_plan_id_fk": { "name": "plan_recommendations_plan_id_plan_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "plan", "columnsFrom": [ "plan_id" ], + "tableTo": "plan", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "plan_recommendations_recommendation_id_recommendation_id_fk": { "name": "plan_recommendations_recommendation_id_recommendation_id_fk", "tableFrom": "plan_recommendations", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation": { + "public.recommendation": { "name": "recommendation", "schema": "", "columns": { @@ -2277,20 +2335,24 @@ "recommendation_property_id_property_id_fk": { "name": "recommendation_property_id_property_id_fk", "tableFrom": "recommendation", - "tableTo": "property", "columnsFrom": [ "property_id" ], + "tableTo": "property", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "recommendation_materials": { + "public.recommendation_materials": { "name": "recommendation_materials", "schema": "", "columns": { @@ -2349,33 +2411,37 @@ "recommendation_materials_recommendation_id_recommendation_id_fk": { "name": "recommendation_materials_recommendation_id_recommendation_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "recommendation", "columnsFrom": [ "recommendation_id" ], + "tableTo": "recommendation", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" }, "recommendation_materials_material_id_material_id_fk": { "name": "recommendation_materials_material_id_material_id_fk", "tableFrom": "recommendation_materials", - "tableTo": "material", "columnsFrom": [ "material_id" ], + "tableTo": "material", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "scenario": { + "public.scenario": { "name": "scenario", "schema": "", "columns": { @@ -2615,20 +2681,24 @@ "scenario_portfolio_id_portfolio_id_fk": { "name": "scenario_portfolio_id_portfolio_id_fk", "tableFrom": "scenario", - "tableTo": "portfolio", "columnsFrom": [ "portfolio_id" ], + "tableTo": "portfolio", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar": { + "public.solar": { "name": "solar", "schema": "", "columns": { @@ -2679,9 +2749,13 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "solar_scenario": { + "public.solar_scenario": { "name": "solar_scenario", "schema": "", "columns": { @@ -2769,20 +2843,24 @@ "solar_scenario_solar_id_solar_id_fk": { "name": "solar_scenario_solar_id_solar_id_fk", "tableFrom": "solar_scenario", - "tableTo": "solar", "columnsFrom": [ "solar_id" ], + "tableTo": "solar", "columnsTo": [ "id" ], - "onDelete": "no action", - "onUpdate": "no action" + "onUpdate": "no action", + "onDelete": "no action" } }, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} }, - "user": { + "public.user": { "name": "user", "schema": "", "columns": { @@ -2833,157 +2911,175 @@ }, "indexes": {}, "foreignKeys": {}, - "compositePrimaryKeys": {} + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "isRLSEnabled": false, + "checkConstraints": {} } }, "enums": { - "document_type": { + "public.document_type": { "name": "document_type", - "values": { - "EPR": "EPR", - "Condition Report": "Condition Report", - "Evidence Report": "Evidence Report", - "Summary Information": "Summary Information", - "Floor Plan": "Floor Plan", - "Scenario Draft EPC": "Scenario Draft EPC", - "Scenario Site Notes": "Scenario Site Notes" - } + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] }, - "cost_unit": { + "public.cost_unit": { "name": "cost_unit", - "values": { - "gbp_sq_meter": "gbp_sq_meter", - "gbp_per_unit": "gbp_per_unit", - "gbp_per_m2": "gbp_per_m2", - "gbp_per_m": "gbp_per_m" - } + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] }, - "depth_unit": { + "public.depth_unit": { "name": "depth_unit", - "values": { - "mm": "mm" - } + "schema": "public", + "values": [ + "mm" + ] }, - "type": { + "public.type": { "name": "type", - "values": { - "suspended_floor_insulation": "suspended_floor_insulation", - "solid_floor_insulation": "solid_floor_insulation", - "external_wall_insulation": "external_wall_insulation", - "internal_wall_insulation": "internal_wall_insulation", - "cavity_wall_insulation": "cavity_wall_insulation", - "mechanical_ventilation": "mechanical_ventilation", - "loft_insulation": "loft_insulation", - "exposed_floor_insulation": "exposed_floor_insulation", - "flat_roof_insulation": "flat_roof_insulation", - "room_roof_insulation": "room_roof_insulation", - "cavity_wall_extraction": "cavity_wall_extraction", - "iwi_wall_demolition": "iwi_wall_demolition", - "iwi_vapour_barrier": "iwi_vapour_barrier", - "iwi_redecoration": "iwi_redecoration", - "suspended_floor_demolition": "suspended_floor_demolition", - "suspended_floor_redecoration": "suspended_floor_redecoration", - "suspended_floor_vapour_barrier": "suspended_floor_vapour_barrier", - "solid_floor_demolition": "solid_floor_demolition", - "solid_floor_preparation": "solid_floor_preparation", - "solid_floor_vapour_barrier": "solid_floor_vapour_barrier", - "solid_floor_redecoration": "solid_floor_redecoration", - "ewi_wall_demolition": "ewi_wall_demolition", - "ewi_wall_preparation": "ewi_wall_preparation", - "ewi_wall_redecoration": "ewi_wall_redecoration", - "low_energy_lighting_installation": "low_energy_lighting_installation", - "flat_roof_preparation": "flat_roof_preparation", - "flat_roof_vapour_barrier": "flat_roof_vapour_barrier", - "flat_roof_waterproofing": "flat_roof_waterproofing", - "windows_glazing": "windows_glazing" - } + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] }, - "r_value_unit": { + "public.r_value_unit": { "name": "r_value_unit", - "values": { - "square_meter_kelvin_per_watt": "square_meter_kelvin_per_watt" - } + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] }, - "thermal_conductivity_unit": { + "public.thermal_conductivity_unit": { "name": "thermal_conductivity_unit", - "values": { - "watt_per_meter_kelvin": "watt_per_meter_kelvin" - } + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] }, - "goal": { + "public.goal": { "name": "goal", - "values": { - "Valuation Improvement": "Valuation Improvement", - "Increasing EPC": "Increasing EPC", - "Reducing CO2 emissions": "Reducing CO2 emissions", - "Energy Savings": "Energy Savings", - "None": "None" - } + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] }, - "role": { + "public.role": { "name": "role", - "values": { - "creator": "creator", - "admin": "admin", - "read": "read", - "write": "write" - } + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] }, - "status": { + "public.status": { "name": "status", - "values": { - "scoping": "scoping", - "survey": "survey", - "assessment": "assessment", - "tendering": "tendering", - "project underway": "project underway", - "completion; status: on track": "completion; status: on track", - "completion; status: delayed": "completion; status: delayed", - "completion; status: at risk": "completion; status: at risk", - "completion; status: completed": "completion; status: completed", - "needs review": "needs review" - } + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] }, - "epc": { + "public.epc": { "name": "epc", - "values": { - "A": "A", - "B": "B", - "C": "C", - "D": "D", - "E": "E", - "F": "F", - "G": "G" - } + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] }, - "creation_status": { + "public.creation_status": { "name": "creation_status", - "values": { - "LOADING": "LOADING", - "READY": "READY", - "ERROR": "ERROR" - } + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] }, - "housing_type": { + "public.housing_type": { "name": "housing_type", - "values": { - "Private": "Private", - "Social": "Social" - } + "schema": "public", + "values": [ + "Private", + "Social" + ] }, - "unit_quantity": { + "public.unit_quantity": { "name": "unit_quantity", - "values": { - "m2": "m2", - "part": "part" - } + "schema": "public", + "values": [ + "m2", + "part" + ] }, - "scenario_type": { + "public.scenario_type": { "name": "scenario_type", - "values": { - "unit": "unit", - "building": "building" - } + "schema": "public", + "values": [ + "unit", + "building" + ] } }, "schemas": {}, @@ -2991,5 +3087,11 @@ "schemas": {}, "tables": {}, "columns": {} - } + }, + "id": "09c524ee-2913-4f6e-8efc-95efa1ec9c0e", + "prevId": "55fba457-401b-4f68-9b8a-a674b1975251", + "sequences": {}, + "policies": {}, + "views": {}, + "roles": {} } \ No newline at end of file diff --git a/src/app/db/migrations/meta/0102_snapshot.json b/src/app/db/migrations/meta/0102_snapshot.json new file mode 100644 index 0000000..5c88c3f --- /dev/null +++ b/src/app/db/migrations/meta/0102_snapshot.json @@ -0,0 +1,3158 @@ +{ + "id": "e199549c-792e-4fad-8344-fcfac0fbbe06", + "prevId": "09c524ee-2913-4f6e-8efc-95efa1ec9c0e", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0103_snapshot.json b/src/app/db/migrations/meta/0103_snapshot.json new file mode 100644 index 0000000..44de2e7 --- /dev/null +++ b/src/app/db/migrations/meta/0103_snapshot.json @@ -0,0 +1,3164 @@ +{ + "id": "38ca4b60-7900-4217-aa5c-2cade86f45ee", + "prevId": "e199549c-792e-4fad-8344-fcfac0fbbe06", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0104_snapshot.json b/src/app/db/migrations/meta/0104_snapshot.json new file mode 100644 index 0000000..11fc06c --- /dev/null +++ b/src/app/db/migrations/meta/0104_snapshot.json @@ -0,0 +1,3170 @@ +{ + "id": "d05f5256-11ad-40a5-8064-faeb5b8a4e26", + "prevId": "38ca4b60-7900-4217-aa5c-2cade86f45ee", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0105_snapshot.json b/src/app/db/migrations/meta/0105_snapshot.json new file mode 100644 index 0000000..1f06364 --- /dev/null +++ b/src/app/db/migrations/meta/0105_snapshot.json @@ -0,0 +1,3171 @@ +{ + "id": "857cbb5a-3cd5-41b4-a5f6-74f0ec3e2e02", + "prevId": "d05f5256-11ad-40a5-8064-faeb5b8a4e26", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/_journal.json b/src/app/db/migrations/meta/_journal.json index 089797c..e6087ed 100644 --- a/src/app/db/migrations/meta/_journal.json +++ b/src/app/db/migrations/meta/_journal.json @@ -715,6 +715,34 @@ "when": 1752931250899, "tag": "0101_bent_stature", "breakpoints": true + }, + { + "idx": 102, + "version": "7", + "when": 1755273707296, + "tag": "0102_fresh_yellow_claw", + "breakpoints": true + }, + { + "idx": 103, + "version": "7", + "when": 1755275098156, + "tag": "0103_redundant_maddog", + "breakpoints": true + }, + { + "idx": 104, + "version": "7", + "when": 1755275275298, + "tag": "0104_awesome_james_howlett", + "breakpoints": true + }, + { + "idx": 105, + "version": "7", + "when": 1755275440983, + "tag": "0105_third_husk", + "breakpoints": true } ] } \ No newline at end of file diff --git a/src/app/db/schema/materials.ts b/src/app/db/schema/materials.ts index cad5e33..ad1f2f4 100644 --- a/src/app/db/schema/materials.ts +++ b/src/app/db/schema/materials.ts @@ -42,12 +42,27 @@ export const MaterialType: [string, ...string[]] = [ "flat_roof_waterproofing", // Windows "windows_glazing", + // vents + "trickle_vent", + "door_undercut", + // solar + "solar_pv", + "solar_battery", + // scaffolding + "scaffolding", + // heating systems + "high_heat_retention_storage_heaters", + // other + "sealing_fireplace" ]; export const materialTypeEnum = pgEnum("type", MaterialType); export const DepthUnit: [string, ...string[]] = ["mm"]; export const depthUnitEnum = pgEnum("depth_unit", DepthUnit); +export const SizeUnit: [string, ...string[]] = ["kWp", "kW", "watt", "storey"]; +export const sizeUnitEnum = pgEnum("size_unit", SizeUnit); + export const CostUnit: [string, ...string[]] = [ "gbp_sq_meter", "gbp_per_unit", @@ -95,6 +110,13 @@ export const material = pgTable("material", { cost: json("cost").$type(), notes: text("notes"), isInstallerQuote: boolean("is_installer_quote").default(false), + innovationRate: real("innovation_rate").default(0), + size: real("size"), + // Can be null + sizeUnit: sizeUnitEnum("size_unit"), + includesScaffolding: boolean("includes_scaffolding").default(false), + includesBattery: boolean("includes_battery").default(false), + batterySize: real("battery_size"), }); export type Material = InferModel; From ad557efed09e948428756e82ffdd2ba556a2312a Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 21 Aug 2025 15:17:27 +0000 Subject: [PATCH 02/10] migrating data --- src/app/db/migrations/meta/_journal.json | 35 +++++++++++++++++++ src/app/db/schema/recommendations.ts | 10 ++++-- .../[propertyId]/documents/page.tsx | 1 + 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/src/app/db/migrations/meta/_journal.json b/src/app/db/migrations/meta/_journal.json index e6087ed..c2de18b 100644 --- a/src/app/db/migrations/meta/_journal.json +++ b/src/app/db/migrations/meta/_journal.json @@ -743,6 +743,41 @@ "when": 1755275440983, "tag": "0105_third_husk", "breakpoints": true + }, + { + "idx": 106, + "version": "7", + "when": 1755710562749, + "tag": "0106_damp_tombstone", + "breakpoints": true + }, + { + "idx": 107, + "version": "7", + "when": 1755713160403, + "tag": "0107_omniscient_molly_hayes", + "breakpoints": true + }, + { + "idx": 108, + "version": "7", + "when": 1755714878033, + "tag": "0108_mighty_outlaw_kid", + "breakpoints": true + }, + { + "idx": 109, + "version": "7", + "when": 1755715023523, + "tag": "0109_flashy_jane_foster", + "breakpoints": true + }, + { + "idx": 110, + "version": "7", + "when": 1755789401931, + "tag": "0110_colossal_hulk", + "breakpoints": true } ] } \ No newline at end of file diff --git a/src/app/db/schema/recommendations.ts b/src/app/db/schema/recommendations.ts index a2dc345..e05f2e5 100644 --- a/src/app/db/schema/recommendations.ts +++ b/src/app/db/schema/recommendations.ts @@ -14,6 +14,7 @@ import { import { Material, material } from "./materials"; import { InferModel } from "drizzle-orm"; import { z } from "zod"; +import { readlink } from "fs"; export const recommendation = pgTable("recommendation", { id: bigserial("id", { mode: "bigint" }).primaryKey(), @@ -25,6 +26,7 @@ export const recommendation = pgTable("recommendation", { measureType: text("measure_type"), description: text("description").notNull(), estimatedCost: real("estimated_cost"), + constingencyCost: real("contingency_cost"), // default will indicate whether a mtaterial is currently being used in a recommendation and we will use this boolean to switch // between materials in the UI and switch off all materials entirely default: boolean("default").notNull(), @@ -43,7 +45,7 @@ export const recommendation = pgTable("recommendation", { alreadyInstalled: boolean("already_installed").default(false), }); -export const unitQuantity: [string, ...string[]] = ["m2", "part"]; +export const unitQuantity: [string, ...string[]] = ["m2", "part", "kwp"]; export const unitQuantityEnum = pgEnum("unit_quantity", unitQuantity); export const recommendationMaterials = pgTable("recommendation_materials", { @@ -58,8 +60,8 @@ export const recommendationMaterials = pgTable("recommendation_materials", { .references(() => material.id), createdAt: timestamp("created_at").notNull().defaultNow(), depth: real("depth"), - quantity: real("quantity").notNull(), - quantityUnit: unitQuantityEnum("quantity_unit").notNull(), + quantity: real("quantity"), + quantityUnit: unitQuantityEnum("quantity_unit"), estimatedCost: real("estimated_cost").notNull(), }); @@ -121,6 +123,8 @@ export const scenario = pgTable("scenario", { isDefault: boolean("is_default").notNull(), // Aggregations that were previously being stored against the portfolio, that are now being stored against the scenario cost: real("cost"), + contingency: real("contingency"), + funding: real("funding"), totalWorkHours: real("total_work_hours"), energySavings: real("energy_savings"), // Unit is always kWh so we don't need to store unit co2EquivalentSavings: real("co2_equivalent_savings"), // Unit is always tonnes so we don't need to store unit diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/documents/page.tsx b/src/app/portfolio/[slug]/building-passport/[propertyId]/documents/page.tsx index ac21963..329cc87 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/documents/page.tsx +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/documents/page.tsx @@ -70,3 +70,4 @@ export default async function DocumentsPage( ); } + From 9cc8ca92ee8d593f9e7a768ea7a5b5e5a1693f23 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 21 Aug 2025 15:17:58 +0000 Subject: [PATCH 03/10] migrations added --- src/app/db/migrations/0106_damp_tombstone.sql | 25 + .../0107_omniscient_molly_hayes.sql | 1 + .../db/migrations/0108_mighty_outlaw_kid.sql | 2 + .../db/migrations/0109_flashy_jane_foster.sql | 2 + src/app/db/migrations/0110_colossal_hulk.sql | 3 + src/app/db/migrations/meta/0106_snapshot.json | 3337 ++++++++++++++++ src/app/db/migrations/meta/0107_snapshot.json | 3337 ++++++++++++++++ src/app/db/migrations/meta/0108_snapshot.json | 3343 ++++++++++++++++ src/app/db/migrations/meta/0109_snapshot.json | 3355 ++++++++++++++++ src/app/db/migrations/meta/0110_snapshot.json | 3356 +++++++++++++++++ src/app/db/schema/funding.ts | 44 + 11 files changed, 16805 insertions(+) create mode 100644 src/app/db/migrations/0106_damp_tombstone.sql create mode 100644 src/app/db/migrations/0107_omniscient_molly_hayes.sql create mode 100644 src/app/db/migrations/0108_mighty_outlaw_kid.sql create mode 100644 src/app/db/migrations/0109_flashy_jane_foster.sql create mode 100644 src/app/db/migrations/0110_colossal_hulk.sql create mode 100644 src/app/db/migrations/meta/0106_snapshot.json create mode 100644 src/app/db/migrations/meta/0107_snapshot.json create mode 100644 src/app/db/migrations/meta/0108_snapshot.json create mode 100644 src/app/db/migrations/meta/0109_snapshot.json create mode 100644 src/app/db/migrations/meta/0110_snapshot.json create mode 100644 src/app/db/schema/funding.ts diff --git a/src/app/db/migrations/0106_damp_tombstone.sql b/src/app/db/migrations/0106_damp_tombstone.sql new file mode 100644 index 0000000..55172c3 --- /dev/null +++ b/src/app/db/migrations/0106_damp_tombstone.sql @@ -0,0 +1,25 @@ +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; \ No newline at end of file diff --git a/src/app/db/migrations/0107_omniscient_molly_hayes.sql b/src/app/db/migrations/0107_omniscient_molly_hayes.sql new file mode 100644 index 0000000..8e6c50f --- /dev/null +++ b/src/app/db/migrations/0107_omniscient_molly_hayes.sql @@ -0,0 +1 @@ +ALTER TABLE "funding_package" RENAME COLUMN "full_project_funding" TO "project_funding"; \ No newline at end of file diff --git a/src/app/db/migrations/0108_mighty_outlaw_kid.sql b/src/app/db/migrations/0108_mighty_outlaw_kid.sql new file mode 100644 index 0000000..c123994 --- /dev/null +++ b/src/app/db/migrations/0108_mighty_outlaw_kid.sql @@ -0,0 +1,2 @@ +ALTER TABLE "funding_package_measures" ALTER COLUMN "material_id" DROP NOT NULL;--> statement-breakpoint +ALTER TABLE "recommendation" ADD COLUMN "contingency_cost" real; \ No newline at end of file diff --git a/src/app/db/migrations/0109_flashy_jane_foster.sql b/src/app/db/migrations/0109_flashy_jane_foster.sql new file mode 100644 index 0000000..878c15b --- /dev/null +++ b/src/app/db/migrations/0109_flashy_jane_foster.sql @@ -0,0 +1,2 @@ +ALTER TABLE "scenario" ADD COLUMN "contingency" real;--> statement-breakpoint +ALTER TABLE "scenario" ADD COLUMN "funding" real; \ No newline at end of file diff --git a/src/app/db/migrations/0110_colossal_hulk.sql b/src/app/db/migrations/0110_colossal_hulk.sql new file mode 100644 index 0000000..b8143b9 --- /dev/null +++ b/src/app/db/migrations/0110_colossal_hulk.sql @@ -0,0 +1,3 @@ +ALTER TYPE "public"."unit_quantity" ADD VALUE 'kwp';--> statement-breakpoint +ALTER TABLE "recommendation_materials" ALTER COLUMN "quantity" DROP NOT NULL;--> statement-breakpoint +ALTER TABLE "recommendation_materials" ALTER COLUMN "quantity_unit" DROP NOT NULL; \ No newline at end of file diff --git a/src/app/db/migrations/meta/0106_snapshot.json b/src/app/db/migrations/meta/0106_snapshot.json new file mode 100644 index 0000000..a0dfa7e --- /dev/null +++ b/src/app/db/migrations/meta/0106_snapshot.json @@ -0,0 +1,3337 @@ +{ + "id": "5fcb6ad0-fcc3-49c4-b55d-a3f8c3adcc2f", + "prevId": "857cbb5a-3cd5-41b4-a5f6-74f0ec3e2e02", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package": { + "name": "funding_package", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scheme": { + "name": "scheme", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "full_project_funding": { + "name": "full_project_funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_uplift": { + "name": "total_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "full_project_score": { + "name": "full_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_plan_id_plan_id_fk": { + "name": "funding_package_plan_id_plan_id_fk", + "tableFrom": "funding_package", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package_measures": { + "name": "funding_package_measures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "funding_package_id": { + "name": "funding_package_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "innovation_uplift": { + "name": "innovation_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_measures_funding_package_id_funding_package_id_fk": { + "name": "funding_package_measures_funding_package_id_funding_package_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "funding_package", + "columnsFrom": [ + "funding_package_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "funding_package_measures_material_id_material_id_fk": { + "name": "funding_package_measures_material_id_material_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0107_snapshot.json b/src/app/db/migrations/meta/0107_snapshot.json new file mode 100644 index 0000000..a324816 --- /dev/null +++ b/src/app/db/migrations/meta/0107_snapshot.json @@ -0,0 +1,3337 @@ +{ + "id": "303ac3c1-3234-4ed4-9e8e-3cfce8690502", + "prevId": "5fcb6ad0-fcc3-49c4-b55d-a3f8c3adcc2f", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package": { + "name": "funding_package", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scheme": { + "name": "scheme", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "project_funding": { + "name": "project_funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_uplift": { + "name": "total_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "full_project_score": { + "name": "full_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_plan_id_plan_id_fk": { + "name": "funding_package_plan_id_plan_id_fk", + "tableFrom": "funding_package", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package_measures": { + "name": "funding_package_measures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "funding_package_id": { + "name": "funding_package_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "innovation_uplift": { + "name": "innovation_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_measures_funding_package_id_funding_package_id_fk": { + "name": "funding_package_measures_funding_package_id_funding_package_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "funding_package", + "columnsFrom": [ + "funding_package_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "funding_package_measures_material_id_material_id_fk": { + "name": "funding_package_measures_material_id_material_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0108_snapshot.json b/src/app/db/migrations/meta/0108_snapshot.json new file mode 100644 index 0000000..5ca840e --- /dev/null +++ b/src/app/db/migrations/meta/0108_snapshot.json @@ -0,0 +1,3343 @@ +{ + "id": "3d90a96b-0618-40fe-bc42-b7517d98cc5d", + "prevId": "303ac3c1-3234-4ed4-9e8e-3cfce8690502", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package": { + "name": "funding_package", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scheme": { + "name": "scheme", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "project_funding": { + "name": "project_funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_uplift": { + "name": "total_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "full_project_score": { + "name": "full_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_plan_id_plan_id_fk": { + "name": "funding_package_plan_id_plan_id_fk", + "tableFrom": "funding_package", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package_measures": { + "name": "funding_package_measures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "funding_package_id": { + "name": "funding_package_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "innovation_uplift": { + "name": "innovation_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_measures_funding_package_id_funding_package_id_fk": { + "name": "funding_package_measures_funding_package_id_funding_package_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "funding_package", + "columnsFrom": [ + "funding_package_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "funding_package_measures_material_id_material_id_fk": { + "name": "funding_package_measures_material_id_material_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency_cost": { + "name": "contingency_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0109_snapshot.json b/src/app/db/migrations/meta/0109_snapshot.json new file mode 100644 index 0000000..a0c2f93 --- /dev/null +++ b/src/app/db/migrations/meta/0109_snapshot.json @@ -0,0 +1,3355 @@ +{ + "id": "d63f1e5e-7331-4dd0-83be-05f3caef8810", + "prevId": "3d90a96b-0618-40fe-bc42-b7517d98cc5d", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package": { + "name": "funding_package", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scheme": { + "name": "scheme", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "project_funding": { + "name": "project_funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_uplift": { + "name": "total_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "full_project_score": { + "name": "full_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_plan_id_plan_id_fk": { + "name": "funding_package_plan_id_plan_id_fk", + "tableFrom": "funding_package", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package_measures": { + "name": "funding_package_measures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "funding_package_id": { + "name": "funding_package_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "innovation_uplift": { + "name": "innovation_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_measures_funding_package_id_funding_package_id_fk": { + "name": "funding_package_measures_funding_package_id_funding_package_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "funding_package", + "columnsFrom": [ + "funding_package_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "funding_package_measures_material_id_material_id_fk": { + "name": "funding_package_measures_material_id_material_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency_cost": { + "name": "contingency_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency": { + "name": "contingency", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "funding": { + "name": "funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0110_snapshot.json b/src/app/db/migrations/meta/0110_snapshot.json new file mode 100644 index 0000000..96071d8 --- /dev/null +++ b/src/app/db/migrations/meta/0110_snapshot.json @@ -0,0 +1,3356 @@ +{ + "id": "7916b81f-afee-4920-8e53-acd90a7fcc6b", + "prevId": "d63f1e5e-7331-4dd0-83be-05f3caef8810", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package": { + "name": "funding_package", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scheme": { + "name": "scheme", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "project_funding": { + "name": "project_funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_uplift": { + "name": "total_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "full_project_score": { + "name": "full_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_plan_id_plan_id_fk": { + "name": "funding_package_plan_id_plan_id_fk", + "tableFrom": "funding_package", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package_measures": { + "name": "funding_package_measures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "funding_package_id": { + "name": "funding_package_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "innovation_uplift": { + "name": "innovation_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_measures_funding_package_id_funding_package_id_fk": { + "name": "funding_package_measures_funding_package_id_funding_package_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "funding_package", + "columnsFrom": [ + "funding_package_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "funding_package_measures_material_id_material_id_fk": { + "name": "funding_package_measures_material_id_material_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency_cost": { + "name": "contingency_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency": { + "name": "contingency", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "funding": { + "name": "funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part", + "kwp" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/schema/funding.ts b/src/app/db/schema/funding.ts new file mode 100644 index 0000000..347a391 --- /dev/null +++ b/src/app/db/schema/funding.ts @@ -0,0 +1,44 @@ +import { + bigserial, + timestamp, + pgTable, + real, + pgEnum, + bigint, +} from "drizzle-orm/pg-core"; +import { InferModel } from "drizzle-orm"; +import { plan } from "./recommendations"; +import { material, materialTypeEnum } from "./materials" + + +export const SchemeEnum: [string, ...string[]] = ["eco4", "gbis", "whlg", "none"]; +export const Scheme = pgEnum("depth_unit", SchemeEnum); + +// funding package table which has the aggregate level data for the funding package. A funding package will be +// tied to a plan +export const fundingPackage = pgTable("funding_package", { + id: bigserial("id", { mode: "bigint" }).primaryKey(), + planId: bigint("plan_id", { mode: "bigint" }) + .notNull() + .references(() => plan.id), + scheme: Scheme("scheme"), + createdAt: timestamp("created_at").notNull().defaultNow(), + rojectFunding: real("project_funding"), + totalUplift: real("total_uplift"), + fullProjectScore: real("full_project_score"), + partialProjectScore: real("partial_project_score"), + upliftProjectScore: real("uplift_project_score"), +}) + +export const fundingPackageMeasures = pgTable("funding_package_measures", { + id: bigserial("id", { mode: "bigint" }).primaryKey(), + fundingPackageId: bigint("funding_package_id", { mode: "bigint" }) + .notNull() + .references(() => fundingPackage.id), + measure: materialTypeEnum("type").notNull(), + materialId: bigint("material_id", { mode: "bigint" }) + .references(() => material.id), // May be null initially + innovationUplift: real("innovation_uplift"), + partialProjectScore: real("partial_project_score"), + upliftProjectScore: real("uplift_project_score"), +}); From 11d1605d5edd9f1ddc32e1351bb8d9016e390b8e Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 21 Aug 2025 17:44:37 +0000 Subject: [PATCH 04/10] funding migrations --- .../db/migrations/0111_eminent_red_wolf.sql | 2 + .../migrations/0112_colossal_nightshade.sql | 1 + .../migrations/0113_bright_lady_bullseye.sql | 1 + src/app/db/migrations/meta/0111_snapshot.json | 3366 ++++++++++++++++ src/app/db/migrations/meta/0112_snapshot.json | 3366 ++++++++++++++++ src/app/db/migrations/meta/0113_snapshot.json | 3367 +++++++++++++++++ src/app/db/migrations/meta/_journal.json | 21 + src/app/db/schema/funding.ts | 4 +- src/app/db/schema/materials.ts | 1 + 9 files changed, 10127 insertions(+), 2 deletions(-) create mode 100644 src/app/db/migrations/0111_eminent_red_wolf.sql create mode 100644 src/app/db/migrations/0112_colossal_nightshade.sql create mode 100644 src/app/db/migrations/0113_bright_lady_bullseye.sql create mode 100644 src/app/db/migrations/meta/0111_snapshot.json create mode 100644 src/app/db/migrations/meta/0112_snapshot.json create mode 100644 src/app/db/migrations/meta/0113_snapshot.json diff --git a/src/app/db/migrations/0111_eminent_red_wolf.sql b/src/app/db/migrations/0111_eminent_red_wolf.sql new file mode 100644 index 0000000..e9d898f --- /dev/null +++ b/src/app/db/migrations/0111_eminent_red_wolf.sql @@ -0,0 +1,2 @@ +CREATE TYPE "public"."scheme" AS ENUM('eco4', 'gbis', 'whlg', 'none');--> statement-breakpoint +ALTER TABLE "funding_package" ALTER COLUMN "scheme" SET DATA TYPE "public"."scheme" USING "scheme"::text::"public"."scheme"; \ No newline at end of file diff --git a/src/app/db/migrations/0112_colossal_nightshade.sql b/src/app/db/migrations/0112_colossal_nightshade.sql new file mode 100644 index 0000000..997490b --- /dev/null +++ b/src/app/db/migrations/0112_colossal_nightshade.sql @@ -0,0 +1 @@ +ALTER TABLE "funding_package_measures" RENAME COLUMN "type" TO "measure"; \ No newline at end of file diff --git a/src/app/db/migrations/0113_bright_lady_bullseye.sql b/src/app/db/migrations/0113_bright_lady_bullseye.sql new file mode 100644 index 0000000..e816457 --- /dev/null +++ b/src/app/db/migrations/0113_bright_lady_bullseye.sql @@ -0,0 +1 @@ +ALTER TYPE "public"."type" ADD VALUE 'air_source_heat_pump' BEFORE 'sealing_fireplace'; \ No newline at end of file diff --git a/src/app/db/migrations/meta/0111_snapshot.json b/src/app/db/migrations/meta/0111_snapshot.json new file mode 100644 index 0000000..2fc7b85 --- /dev/null +++ b/src/app/db/migrations/meta/0111_snapshot.json @@ -0,0 +1,3366 @@ +{ + "id": "77abbda2-f51b-4e48-b602-c6e9ea78beb8", + "prevId": "7916b81f-afee-4920-8e53-acd90a7fcc6b", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package": { + "name": "funding_package", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scheme": { + "name": "scheme", + "type": "scheme", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "project_funding": { + "name": "project_funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_uplift": { + "name": "total_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "full_project_score": { + "name": "full_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_plan_id_plan_id_fk": { + "name": "funding_package_plan_id_plan_id_fk", + "tableFrom": "funding_package", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package_measures": { + "name": "funding_package_measures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "funding_package_id": { + "name": "funding_package_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "innovation_uplift": { + "name": "innovation_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_measures_funding_package_id_funding_package_id_fk": { + "name": "funding_package_measures_funding_package_id_funding_package_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "funding_package", + "columnsFrom": [ + "funding_package_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "funding_package_measures_material_id_material_id_fk": { + "name": "funding_package_measures_material_id_material_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency_cost": { + "name": "contingency_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency": { + "name": "contingency", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "funding": { + "name": "funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.scheme": { + "name": "scheme", + "schema": "public", + "values": [ + "eco4", + "gbis", + "whlg", + "none" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part", + "kwp" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0112_snapshot.json b/src/app/db/migrations/meta/0112_snapshot.json new file mode 100644 index 0000000..d98f341 --- /dev/null +++ b/src/app/db/migrations/meta/0112_snapshot.json @@ -0,0 +1,3366 @@ +{ + "id": "db0080a8-0737-4bbe-81b4-d57a7e408cc8", + "prevId": "77abbda2-f51b-4e48-b602-c6e9ea78beb8", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package": { + "name": "funding_package", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scheme": { + "name": "scheme", + "type": "scheme", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "project_funding": { + "name": "project_funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_uplift": { + "name": "total_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "full_project_score": { + "name": "full_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_plan_id_plan_id_fk": { + "name": "funding_package_plan_id_plan_id_fk", + "tableFrom": "funding_package", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package_measures": { + "name": "funding_package_measures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "funding_package_id": { + "name": "funding_package_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "measure": { + "name": "measure", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "innovation_uplift": { + "name": "innovation_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_measures_funding_package_id_funding_package_id_fk": { + "name": "funding_package_measures_funding_package_id_funding_package_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "funding_package", + "columnsFrom": [ + "funding_package_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "funding_package_measures_material_id_material_id_fk": { + "name": "funding_package_measures_material_id_material_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency_cost": { + "name": "contingency_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency": { + "name": "contingency", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "funding": { + "name": "funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.scheme": { + "name": "scheme", + "schema": "public", + "values": [ + "eco4", + "gbis", + "whlg", + "none" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part", + "kwp" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/0113_snapshot.json b/src/app/db/migrations/meta/0113_snapshot.json new file mode 100644 index 0000000..a7c9f50 --- /dev/null +++ b/src/app/db/migrations/meta/0113_snapshot.json @@ -0,0 +1,3367 @@ +{ + "id": "9cc24ab0-7996-4b20-bcd5-780f57770e5d", + "prevId": "db0080a8-0737-4bbe-81b4-d57a7e408cc8", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.energy_assessments": { + "name": "energy_assessments", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "uprn_source": { + "name": "uprn_source", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_energy_efficiency": { + "name": "current_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "current_energy_rating": { + "name": "current_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address1": { + "name": "address1", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address2": { + "name": "address2", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address3": { + "name": "address3", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "posttown": { + "name": "posttown", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "county": { + "name": "county", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency_label": { + "name": "constituency_label", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "low_energy_fixed_light_count": { + "name": "low_energy_fixed_light_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "construction_age_band": { + "name": "construction_age_band", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_energy_eff": { + "name": "mainheat_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_env_eff": { + "name": "windows_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_energy_eff": { + "name": "lighting_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_potential": { + "name": "environment_impact_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatcont_description": { + "name": "mainheatcont_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_energy_eff": { + "name": "sheating_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "local_authority_label": { + "name": "local_authority_label", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "fixed_lighting_outlets_count": { + "name": "fixed_lighting_outlets_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mechanical_ventilation": { + "name": "mechanical_ventilation", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "solar_water_heating_flag": { + "name": "solar_water_heating_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_potential": { + "name": "co2_emissions_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_description": { + "name": "floor_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_potential": { + "name": "energy_consumption_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_open_fireplaces": { + "name": "number_open_fireplaces", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_description": { + "name": "windows_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "glazed_area": { + "name": "glazed_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "inspection_date": { + "name": "inspection_date", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true + }, + "mains_gas_flag": { + "name": "mains_gas_flag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emiss_curr_per_floor_area": { + "name": "co2_emiss_curr_per_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "flat_storey_count": { + "name": "flat_storey_count", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_energy_eff": { + "name": "roof_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "environment_impact_current": { + "name": "environment_impact_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_description": { + "name": "roof_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_energy_eff": { + "name": "floor_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_habitable_rooms": { + "name": "number_habitable_rooms", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_env_eff": { + "name": "hot_water_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_energy_eff": { + "name": "mainheatc_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_fuel": { + "name": "main_fuel", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_env_eff": { + "name": "lighting_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "windows_energy_eff": { + "name": "windows_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_env_eff": { + "name": "floor_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "sheating_env_eff": { + "name": "sheating_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_description": { + "name": "lighting_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "roof_env_eff": { + "name": "roof_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_energy_eff": { + "name": "walls_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "photo_supply": { + "name": "photo_supply", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_potential": { + "name": "lighting_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheat_env_eff": { + "name": "mainheat_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "multi_glaze_proportion": { + "name": "multi_glaze_proportion", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "main_heating_controls": { + "name": "main_heating_controls", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flat_top_storey": { + "name": "flat_top_storey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "secondheat_description": { + "name": "secondheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_env_eff": { + "name": "walls_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "transaction_type": { + "name": "transaction_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "extension_count": { + "name": "extension_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "mainheatc_env_eff": { + "name": "mainheatc_env_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lmk_key": { + "name": "lmk_key", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "wind_turbine_count": { + "name": "wind_turbine_count", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_level": { + "name": "floor_level", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_efficiency": { + "name": "potential_energy_efficiency", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "potential_energy_rating": { + "name": "potential_energy_rating", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_energy_eff": { + "name": "hot_water_energy_eff", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "low_energy_lighting": { + "name": "low_energy_lighting", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "walls_description": { + "name": "walls_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hotwater_description": { + "name": "hotwater_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "co2_emissions_current": { + "name": "co2_emissions_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "heating_cost_potential": { + "name": "heating_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hot_water_cost_potential": { + "name": "hot_water_cost_potential", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_consumption_current": { + "name": "energy_consumption_current", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "lodgement_date": { + "name": "lodgement_date", + "type": "date", + "primaryKey": false, + "notNull": true + }, + "lodgement_datetime": { + "name": "lodgement_datetime", + "type": "timestamp (6)", + "primaryKey": false, + "notNull": true + }, + "mainheat_description": { + "name": "mainheat_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "glazed_type": { + "name": "glazed_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "file_location": { + "name": "file_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_name": { + "name": "surveyor_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "surveyor_company": { + "name": "surveyor_company", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "space_heating_kwh": { + "name": "space_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "water_heating_kwh": { + "name": "water_heating_kwh", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "number_of_doors": { + "name": "number_of_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_insulated_doors": { + "name": "number_of_insulated_doors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "number_of_floors": { + "name": "number_of_floors", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "insulation_wall_area": { + "name": "insulation_wall_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "heat_loss_perimeter": { + "name": "heat_loss_perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "party_wall_length": { + "name": "party_wall_length", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "perimeter": { + "name": "perimeter", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "rooms_with_bath_and_or_shower": { + "name": "rooms_with_bath_and_or_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "rooms_with_mixer_shower_no_bath": { + "name": "rooms_with_mixer_shower_no_bath", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "room_with_bath_and_mixer_shower": { + "name": "room_with_bath_and_mixer_shower", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "percent_draftproofed": { + "name": "percent_draftproofed", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "has_hot_water_cylinder": { + "name": "has_hot_water_cylinder", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_type": { + "name": "cylinder_insulation_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cylinder_insulation_thickness": { + "name": "cylinder_insulation_thickness", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "cylinder_thermostat": { + "name": "cylinder_thermostat", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "main_dwelling_ground_floor_area": { + "name": "main_dwelling_ground_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_windows": { + "name": "number_of_windows", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "windows_area": { + "name": "windows_area", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_documents": { + "name": "energy_assessment_documents", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "document_type": { + "name": "document_type", + "type": "document_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "document_location": { + "name": "document_location", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "uploaded_at": { + "name": "uploaded_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_documents_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk": { + "name": "energy_assessment_documents_scenario_id_energy_assessment_scenarios_id_fk", + "tableFrom": "energy_assessment_documents", + "tableTo": "energy_assessment_scenarios", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.energy_assessment_scenarios": { + "name": "energy_assessment_scenarios", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "scenario_name": { + "name": "scenario_name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "energy_assessment_id": { + "name": "energy_assessment_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk": { + "name": "energy_assessment_scenarios_energy_assessment_id_energy_assessments_id_fk", + "tableFrom": "energy_assessment_scenarios", + "tableTo": "energy_assessments", + "columnsFrom": [ + "energy_assessment_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package": { + "name": "funding_package", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scheme": { + "name": "scheme", + "type": "scheme", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "project_funding": { + "name": "project_funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_uplift": { + "name": "total_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "full_project_score": { + "name": "full_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_plan_id_plan_id_fk": { + "name": "funding_package_plan_id_plan_id_fk", + "tableFrom": "funding_package", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.funding_package_measures": { + "name": "funding_package_measures", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "funding_package_id": { + "name": "funding_package_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "measure": { + "name": "measure", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "innovation_uplift": { + "name": "innovation_uplift", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "partial_project_score": { + "name": "partial_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "uplift_project_score": { + "name": "uplift_project_score", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "funding_package_measures_funding_package_id_funding_package_id_fk": { + "name": "funding_package_measures_funding_package_id_funding_package_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "funding_package", + "columnsFrom": [ + "funding_package_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "funding_package_measures_material_id_material_id_fk": { + "name": "funding_package_measures_material_id_material_id_fk", + "tableFrom": "funding_package_measures", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.material": { + "name": "material", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "type": { + "name": "type", + "type": "type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "depth": { + "name": "depth", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "depth_unit": { + "name": "depth_unit", + "type": "depth_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "cost_unit": { + "name": "cost_unit", + "type": "cost_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "r_value_per_mm": { + "name": "r_value_per_mm", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "r_value_unit": { + "name": "r_value_unit", + "type": "r_value_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity": { + "name": "thermal_conductivity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "type": "thermal_conductivity_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "link": { + "name": "link", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_active": { + "name": "is_active", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "prime_material_cost": { + "name": "prime_material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "material_cost": { + "name": "material_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_cost": { + "name": "labour_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_hours_per_unit": { + "name": "labour_hours_per_unit", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "plant_cost": { + "name": "plant_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_cost": { + "name": "total_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "json", + "primaryKey": false, + "notNull": false + }, + "notes": { + "name": "notes", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_installer_quote": { + "name": "is_installer_quote", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "innovation_rate": { + "name": "innovation_rate", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 0 + }, + "size": { + "name": "size", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "size_unit": { + "name": "size_unit", + "type": "size_unit", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "includes_scaffolding": { + "name": "includes_scaffolding", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "includes_battery": { + "name": "includes_battery", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "battery_size": { + "name": "battery_size", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolio": { + "name": "portfolio", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.portfolioUsers": { + "name": "portfolioUsers", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "role": { + "name": "role", + "type": "role", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": { + "portfolioUsers_user_id_user_id_fk": { + "name": "portfolioUsers_user_id_user_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "user", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "portfolioUsers_portfolio_id_portfolio_id_fk": { + "name": "portfolioUsers_portfolio_id_portfolio_id_fk", + "tableFrom": "portfolioUsers", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey": { + "name": "non_intrusive_survey", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "survey_date": { + "name": "survey_date", + "type": "timestamp", + "primaryKey": false, + "notNull": true + }, + "surveyor": { + "name": "surveyor", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.non_intrusive_survey_notes": { + "name": "non_intrusive_survey_notes", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "survey_id": { + "name": "survey_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "note": { + "name": "note", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk": { + "name": "non_intrusive_survey_notes_survey_id_non_intrusive_survey_id_fk", + "tableFrom": "non_intrusive_survey_notes", + "tableTo": "non_intrusive_survey", + "columnsFrom": [ + "survey_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property": { + "name": "property", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "creation_status": { + "name": "creation_status", + "type": "creation_status", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "building_reference_number": { + "name": "building_reference_number", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "status": { + "name": "status", + "type": "status", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "address": { + "name": "address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "postcode": { + "name": "postcode", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "has_pre_condition_report": { + "name": "has_pre_condition_report", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "has_recommendations": { + "name": "has_recommendations", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "property_type": { + "name": "property_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "built_form": { + "name": "built_form", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "local_authority": { + "name": "local_authority", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "constituency": { + "name": "constituency", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_rooms": { + "name": "number_of_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "year_built": { + "name": "year_built", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "tenure": { + "name": "tenure", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "current_epc_rating": { + "name": "current_epc_rating", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "current_sap_points": { + "name": "current_sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_valuation": { + "name": "current_valuation", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_portfolio_id_portfolio_id_fk": { + "name": "property_portfolio_id_portfolio_id_fk", + "tableFrom": "property", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_epc": { + "name": "property_details_epc", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "full_address": { + "name": "full_address", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "total_floor_area": { + "name": "total_floor_area", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "walls": { + "name": "walls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "walls_rating": { + "name": "walls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "roof": { + "name": "roof", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "roof_rating": { + "name": "roof_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor": { + "name": "floor", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "floor_rating": { + "name": "floor_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "windows": { + "name": "windows", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "windows_rating": { + "name": "windows_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating": { + "name": "heating", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_rating": { + "name": "heating_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "heating_controls": { + "name": "heating_controls", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "heating_controls_rating": { + "name": "heating_controls_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "hot_water": { + "name": "hot_water", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "hot_water_rating": { + "name": "hot_water_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "lighting": { + "name": "lighting", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "lighting_rating": { + "name": "lighting_rating", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "mainfuel": { + "name": "mainfuel", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ventilation": { + "name": "ventilation", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "solar_pv": { + "name": "solar_pv", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "solar_hot_water": { + "name": "solar_hot_water", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "wind_turbine": { + "name": "wind_turbine", + "type": "smallint", + "primaryKey": false, + "notNull": false + }, + "floor_height": { + "name": "floor_height", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_heated_rooms": { + "name": "number_heated_rooms", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "heat_loss_corridor": { + "name": "heat_loss_corridor", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "unheated_corridor_length": { + "name": "unheated_corridor_length", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "number_of_open_fireplaces": { + "name": "number_of_open_fireplaces", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_extensions": { + "name": "number_of_extensions", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "number_of_storeys": { + "name": "number_of_storeys", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "mains_gas": { + "name": "mains_gas", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "energy_tariff": { + "name": "energy_tariff", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "primary_energy_consumption": { + "name": "primary_energy_consumption", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_emissions": { + "name": "co2_emissions", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand": { + "name": "current_energy_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "current_energy_demand_heating_hotwater": { + "name": "current_energy_demand_heating_hotwater", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "estimated": { + "name": "estimated", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + }, + "heating_cost_current": { + "name": "heating_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "hot_water_cost_current": { + "name": "hot_water_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "lighting_cost_current": { + "name": "lighting_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "appliances_cost_current": { + "name": "appliances_cost_current", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "gas_standing_charge": { + "name": "gas_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "electricity_standing_charge": { + "name": "electricity_standing_charge", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_details_epc_property_id_property_id_fk": { + "name": "property_details_epc_property_id_property_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_details_epc_portfolio_id_portfolio_id_fk": { + "name": "property_details_epc_portfolio_id_portfolio_id_fk", + "tableFrom": "property_details_epc", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_meter": { + "name": "property_details_meter", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "energy_supplier": { + "name": "energy_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "gas_supplier": { + "name": "gas_supplier", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "meter_reading_total": { + "name": "meter_reading_total", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_electricity": { + "name": "meter_reading_electricity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "meter_reading_gas": { + "name": "meter_reading_gas", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_details_spatial": { + "name": "property_details_spatial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "x_coordinate": { + "name": "x_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "y_coordinate": { + "name": "y_coordinate", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "conservation_status": { + "name": "conservation_status", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_listed_building": { + "name": "is_listed_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_heritage_building": { + "name": "is_heritage_building", + "type": "boolean", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.property_targets": { + "name": "property_targets", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "epc": { + "name": "epc", + "type": "epc", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "property_targets_property_id_property_id_fk": { + "name": "property_targets_property_id_property_id_fk", + "tableFrom": "property_targets", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "property_targets_portfolio_id_portfolio_id_fk": { + "name": "property_targets_portfolio_id_portfolio_id_fk", + "tableFrom": "property_targets", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan": { + "name": "plan", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_id": { + "name": "scenario_id", + "type": "bigint", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "valuation_increase_lower_bound": { + "name": "valuation_increase_lower_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_upper_bound": { + "name": "valuation_increase_upper_bound", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "valuation_increase_average": { + "name": "valuation_increase_average", + "type": "real", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "plan_portfolio_id_portfolio_id_fk": { + "name": "plan_portfolio_id_portfolio_id_fk", + "tableFrom": "plan", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_property_id_property_id_fk": { + "name": "plan_property_id_property_id_fk", + "tableFrom": "plan", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_scenario_id_scenario_id_fk": { + "name": "plan_scenario_id_scenario_id_fk", + "tableFrom": "plan", + "tableTo": "scenario", + "columnsFrom": [ + "scenario_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.plan_recommendations": { + "name": "plan_recommendations", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "plan_id": { + "name": "plan_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "plan_recommendations_plan_id_plan_id_fk": { + "name": "plan_recommendations_plan_id_plan_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "plan", + "columnsFrom": [ + "plan_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "plan_recommendations_recommendation_id_recommendation_id_fk": { + "name": "plan_recommendations_recommendation_id_recommendation_id_fk", + "tableFrom": "plan_recommendations", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation": { + "name": "recommendation", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "property_id": { + "name": "property_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "type": { + "name": "type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "measure_type": { + "name": "measure_type", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency_cost": { + "name": "contingency_cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "default": { + "name": "default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "starting_u_value": { + "name": "starting_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "new_u_value": { + "name": "new_u_value", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "sap_points": { + "name": "sap_points", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "heat_demand": { + "name": "heat_demand", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "kwh_savings": { + "name": "kwh_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "rental_yield_increase": { + "name": "rental_yield_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "already_installed": { + "name": "already_installed", + "type": "boolean", + "primaryKey": false, + "notNull": false, + "default": false + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_property_id_property_id_fk": { + "name": "recommendation_property_id_property_id_fk", + "tableFrom": "recommendation", + "tableTo": "property", + "columnsFrom": [ + "property_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.recommendation_materials": { + "name": "recommendation_materials", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "recommendation_id": { + "name": "recommendation_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "material_id": { + "name": "material_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "depth": { + "name": "depth", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity": { + "name": "quantity", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "quantity_unit": { + "name": "quantity_unit", + "type": "unit_quantity", + "typeSchema": "public", + "primaryKey": false, + "notNull": false + }, + "estimated_cost": { + "name": "estimated_cost", + "type": "real", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "recommendation_materials_recommendation_id_recommendation_id_fk": { + "name": "recommendation_materials_recommendation_id_recommendation_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "recommendation", + "columnsFrom": [ + "recommendation_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "recommendation_materials_material_id_material_id_fk": { + "name": "recommendation_materials_material_id_material_id_fk", + "tableFrom": "recommendation_materials", + "tableTo": "material", + "columnsFrom": [ + "material_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.scenario": { + "name": "scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "budget": { + "name": "budget", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "portfolio_id": { + "name": "portfolio_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "housing_type": { + "name": "housing_type", + "type": "housing_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal": { + "name": "goal", + "type": "goal", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "goal_value": { + "name": "goal_value", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ashp_cop": { + "name": "ashp_cop", + "type": "real", + "primaryKey": false, + "notNull": false, + "default": 2.8 + }, + "trigger_file_path": { + "name": "trigger_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "already_installed_file_path": { + "name": "already_installed_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "patches_file_path": { + "name": "patches_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "non_invasive_recommendations_file_path": { + "name": "non_invasive_recommendations_file_path", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "exclusions": { + "name": "exclusions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "multi_plan": { + "name": "multi_plan", + "type": "boolean", + "primaryKey": false, + "notNull": false + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "contingency": { + "name": "contingency", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "funding": { + "name": "funding", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "total_work_hours": { + "name": "total_work_hours", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_savings": { + "name": "energy_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "co2_equivalent_savings": { + "name": "co2_equivalent_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "energy_cost_savings": { + "name": "energy_cost_savings", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "property_valuation_increase": { + "name": "property_valuation_increase", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "labour_days": { + "name": "labour_days", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_pre_retrofit": { + "name": "epc_breakdown_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "epc_breakdown_post_retrofit": { + "name": "epc_breakdown_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "number_of_properties": { + "name": "number_of_properties", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "n_units_to_retrofit": { + "name": "n_units_to_retrofit", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_pre_retrofit": { + "name": "co2_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "co2_per_unit_post_retrofit": { + "name": "co2_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_pre_retrofit": { + "name": "energy_bill_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_bill_per_unit_post_retrofit": { + "name": "energy_bill_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_pre_retrofit": { + "name": "energy_consumption_per_unit_pre_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "energy_consumption_per_unit_post_retrofit": { + "name": "energy_consumption_per_unit_post_retrofit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_improvement_per_unit": { + "name": "valuation_improvement_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_unit": { + "name": "cost_per_unit", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_co2_saved": { + "name": "cost_per_co2_saved", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "cost_per_sap_point": { + "name": "cost_per_sap_point", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "valuation_return_on_investment": { + "name": "valuation_return_on_investment", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "scenario_portfolio_id_portfolio_id_fk": { + "name": "scenario_portfolio_id_portfolio_id_fk", + "tableFrom": "scenario", + "tableTo": "portfolio", + "columnsFrom": [ + "portfolio_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar": { + "name": "solar", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "longitude": { + "name": "longitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "latitude": { + "name": "latitude", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "uprn": { + "name": "uprn", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "google_api_response": { + "name": "google_api_response", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.solar_scenario": { + "name": "solar_scenario", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "solar_id": { + "name": "solar_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "scenario_type": { + "name": "scenario_type", + "type": "scenario_type", + "typeSchema": "public", + "primaryKey": false, + "notNull": true + }, + "number_panels": { + "name": "number_panels", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "array_kwhp": { + "name": "array_kwhp", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "lifetime_dc_kwh": { + "name": "lifetime_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "yearly_dc_kwh": { + "name": "yearly_dc_kwh", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "lifetime_ac_kwh": { + "name": "lifetime_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "yearly_ac_kwh": { + "name": "yearly_ac_kwh", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "cost": { + "name": "cost", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "expected_payback_years": { + "name": "expected_payback_years", + "type": "real", + "primaryKey": false, + "notNull": false + }, + "panelled_roof_area": { + "name": "panelled_roof_area", + "type": "real", + "primaryKey": false, + "notNull": true + }, + "is_default": { + "name": "is_default", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "solar_scenario_solar_id_solar_id_fk": { + "name": "solar_scenario_solar_id_solar_id_fk", + "tableFrom": "solar_scenario", + "tableTo": "solar", + "columnsFrom": [ + "solar_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigserial", + "primaryKey": true, + "notNull": true + }, + "firstName": { + "name": "firstName", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "oauth_id": { + "name": "oauth_id", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "oauth_provider": { + "name": "oauth_provider", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "created_at": { + "name": "created_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp (6) with time zone", + "primaryKey": false, + "notNull": true, + "default": "now()" + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "policies": {}, + "checkConstraints": {}, + "isRLSEnabled": false + } + }, + "enums": { + "public.document_type": { + "name": "document_type", + "schema": "public", + "values": [ + "EPR", + "Condition Report", + "Evidence Report", + "Summary Information", + "Floor Plan", + "Scenario Draft EPC", + "Scenario Site Notes" + ] + }, + "public.scheme": { + "name": "scheme", + "schema": "public", + "values": [ + "eco4", + "gbis", + "whlg", + "none" + ] + }, + "public.cost_unit": { + "name": "cost_unit", + "schema": "public", + "values": [ + "gbp_sq_meter", + "gbp_per_unit", + "gbp_per_m2", + "gbp_per_m" + ] + }, + "public.depth_unit": { + "name": "depth_unit", + "schema": "public", + "values": [ + "mm" + ] + }, + "public.type": { + "name": "type", + "schema": "public", + "values": [ + "suspended_floor_insulation", + "solid_floor_insulation", + "external_wall_insulation", + "internal_wall_insulation", + "cavity_wall_insulation", + "mechanical_ventilation", + "loft_insulation", + "exposed_floor_insulation", + "flat_roof_insulation", + "room_roof_insulation", + "cavity_wall_extraction", + "iwi_wall_demolition", + "iwi_vapour_barrier", + "iwi_redecoration", + "suspended_floor_demolition", + "suspended_floor_redecoration", + "suspended_floor_vapour_barrier", + "solid_floor_demolition", + "solid_floor_preparation", + "solid_floor_vapour_barrier", + "solid_floor_redecoration", + "ewi_wall_demolition", + "ewi_wall_preparation", + "ewi_wall_redecoration", + "low_energy_lighting_installation", + "flat_roof_preparation", + "flat_roof_vapour_barrier", + "flat_roof_waterproofing", + "windows_glazing", + "trickle_vent", + "door_undercut", + "solar_pv", + "solar_battery", + "scaffolding", + "high_heat_retention_storage_heaters", + "air_source_heat_pump", + "sealing_fireplace" + ] + }, + "public.r_value_unit": { + "name": "r_value_unit", + "schema": "public", + "values": [ + "square_meter_kelvin_per_watt" + ] + }, + "public.size_unit": { + "name": "size_unit", + "schema": "public", + "values": [ + "kWp", + "kW", + "watt", + "storey" + ] + }, + "public.thermal_conductivity_unit": { + "name": "thermal_conductivity_unit", + "schema": "public", + "values": [ + "watt_per_meter_kelvin" + ] + }, + "public.goal": { + "name": "goal", + "schema": "public", + "values": [ + "Valuation Improvement", + "Increasing EPC", + "Reducing CO2 emissions", + "Energy Savings", + "None" + ] + }, + "public.role": { + "name": "role", + "schema": "public", + "values": [ + "creator", + "admin", + "read", + "write" + ] + }, + "public.status": { + "name": "status", + "schema": "public", + "values": [ + "scoping", + "survey", + "assessment", + "tendering", + "project underway", + "completion; status: on track", + "completion; status: delayed", + "completion; status: at risk", + "completion; status: completed", + "needs review" + ] + }, + "public.epc": { + "name": "epc", + "schema": "public", + "values": [ + "A", + "B", + "C", + "D", + "E", + "F", + "G" + ] + }, + "public.creation_status": { + "name": "creation_status", + "schema": "public", + "values": [ + "LOADING", + "READY", + "ERROR" + ] + }, + "public.housing_type": { + "name": "housing_type", + "schema": "public", + "values": [ + "Private", + "Social" + ] + }, + "public.unit_quantity": { + "name": "unit_quantity", + "schema": "public", + "values": [ + "m2", + "part", + "kwp" + ] + }, + "public.scenario_type": { + "name": "scenario_type", + "schema": "public", + "values": [ + "unit", + "building" + ] + } + }, + "schemas": {}, + "sequences": {}, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "columns": {}, + "schemas": {}, + "tables": {} + } +} \ No newline at end of file diff --git a/src/app/db/migrations/meta/_journal.json b/src/app/db/migrations/meta/_journal.json index c2de18b..29f34e9 100644 --- a/src/app/db/migrations/meta/_journal.json +++ b/src/app/db/migrations/meta/_journal.json @@ -778,6 +778,27 @@ "when": 1755789401931, "tag": "0110_colossal_hulk", "breakpoints": true + }, + { + "idx": 111, + "version": "7", + "when": 1755794600885, + "tag": "0111_eminent_red_wolf", + "breakpoints": true + }, + { + "idx": 112, + "version": "7", + "when": 1755795339728, + "tag": "0112_colossal_nightshade", + "breakpoints": true + }, + { + "idx": 113, + "version": "7", + "when": 1755798209029, + "tag": "0113_bright_lady_bullseye", + "breakpoints": true } ] } \ No newline at end of file diff --git a/src/app/db/schema/funding.ts b/src/app/db/schema/funding.ts index 347a391..e3c7bf3 100644 --- a/src/app/db/schema/funding.ts +++ b/src/app/db/schema/funding.ts @@ -12,7 +12,7 @@ import { material, materialTypeEnum } from "./materials" export const SchemeEnum: [string, ...string[]] = ["eco4", "gbis", "whlg", "none"]; -export const Scheme = pgEnum("depth_unit", SchemeEnum); +export const Scheme = pgEnum("scheme", SchemeEnum); // funding package table which has the aggregate level data for the funding package. A funding package will be // tied to a plan @@ -35,7 +35,7 @@ export const fundingPackageMeasures = pgTable("funding_package_measures", { fundingPackageId: bigint("funding_package_id", { mode: "bigint" }) .notNull() .references(() => fundingPackage.id), - measure: materialTypeEnum("type").notNull(), + measure: materialTypeEnum("measure").notNull(), materialId: bigint("material_id", { mode: "bigint" }) .references(() => material.id), // May be null initially innovationUplift: real("innovation_uplift"), diff --git a/src/app/db/schema/materials.ts b/src/app/db/schema/materials.ts index ad1f2f4..60205b7 100644 --- a/src/app/db/schema/materials.ts +++ b/src/app/db/schema/materials.ts @@ -52,6 +52,7 @@ export const MaterialType: [string, ...string[]] = [ "scaffolding", // heating systems "high_heat_retention_storage_heaters", + "air_source_heat_pump", // other "sealing_fireplace" ]; From 85b38ea43ccfb0f7812589c39f17edaedab81613 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 21 Aug 2025 18:13:09 +0000 Subject: [PATCH 05/10] added funding data to front end --- src/app/db/db.ts | 2 ++ src/app/db/schema/funding.ts | 3 +++ .../[propertyId]/plans/[planId]/page.tsx | 5 ++++- .../building-passport/[propertyId]/utils.ts | 17 ++++++++++++++++- 4 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/app/db/db.ts b/src/app/db/db.ts index 6e89c71..8798282 100644 --- a/src/app/db/db.ts +++ b/src/app/db/db.ts @@ -7,6 +7,7 @@ import * as recommendationSchema from "@/app/db/schema/recommendations"; import * as materialSchema from "@/app/db/schema/materials"; import * as solarSchema from "@/app/db/schema/solar"; import * as EnergyAssessmentsSchema from "@/app/db/schema/energy_assessments"; +import * as FundingSchema from "@/app/db/schema/funding"; import * as Relations from "@/app/db/schema/relations"; export const pool = new Pool({ @@ -27,6 +28,7 @@ const schema = { ...solarSchema, ...Relations, ...EnergyAssessmentsSchema, + ...FundingSchema, }; export const db = drizzle(pool, { diff --git a/src/app/db/schema/funding.ts b/src/app/db/schema/funding.ts index e3c7bf3..d3976e6 100644 --- a/src/app/db/schema/funding.ts +++ b/src/app/db/schema/funding.ts @@ -42,3 +42,6 @@ export const fundingPackageMeasures = pgTable("funding_package_measures", { partialProjectScore: real("partial_project_score"), upliftProjectScore: real("uplift_project_score"), }); + + +export type FundingPackage = typeof fundingPackage.$inferSelect; \ No newline at end of file diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx index e3e611f..05efebb 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx @@ -1,5 +1,5 @@ import RecommendationContainer from "@/app/components/building-passport/RecommendationContainer"; -import { getPropertyMeta, getRecommendations, getPlanMeta } from "../../utils"; +import { getPropertyMeta, getRecommendations, getPlanMeta, getPlanFunding } from "../../utils"; export default async function Recommendations( props: { @@ -10,6 +10,9 @@ export default async function Recommendations( const propertyMeta = await getPropertyMeta(params.propertyId); const recommendations = await getRecommendations(params.planId); const planMeta = await getPlanMeta(params.planId); + const funding = await getPlanFunding(params.planId); + + console.log("Funding Data:", funding); return (
diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts b/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts index 487ea86..b5e11d8 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts @@ -22,14 +22,29 @@ import { energyAssessment, EnergyAssessment, energyAssessmentDocuments, - EnergyAssessmentDocument, EnergyAssessmentDocumentWithScenario, } from "@/app/db/schema/energy_assessments"; +import { + fundingPackage, + FundingPackage +} from "@/app/db/schema/funding"; type RecommendationList = { recommendation: Recommendation; }[]; +export async function getPlanFunding(planId: string): Promise { + const data = await db.query.fundingPackage.findMany({ + where: eq(fundingPackage.planId, BigInt(planId)), + }); + + if (!data) { + throw new Error("Network response was not ok"); + } + + return data; +} + export async function getEnergyAssessment( uprn: number ): Promise { From 6cffb3a3d2f96bcd1b47f0d155431738b13f788d Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 21 Aug 2025 21:35:08 +0000 Subject: [PATCH 06/10] first implementation of funding into the app --- src/app/components/Buttons.tsx | 4 +- .../EnergyEfficiencyImpactCard.tsx | 118 ++++++++++-------- .../RecommendationContainer.tsx | 12 ++ .../ValuationImpactComponent.tsx | 87 +++++++++---- .../building-passport/WorksPackageCard.tsx | 29 +++-- src/app/db/schema/funding.ts | 9 +- src/app/db/schema/relations.ts | 19 ++- .../[propertyId]/plans/[planId]/page.tsx | 1 + .../building-passport/[propertyId]/utils.ts | 8 +- src/app/utils.ts | 30 +++-- 10 files changed, 214 insertions(+), 103 deletions(-) diff --git a/src/app/components/Buttons.tsx b/src/app/components/Buttons.tsx index 962e9cf..e21d600 100644 --- a/src/app/components/Buttons.tsx +++ b/src/app/components/Buttons.tsx @@ -30,7 +30,8 @@ export function BrandButton({ | "brandblue" | "brandgold" | "brandmidblue" - | "brandlightblue"; // Restrict backgroundColor to these two options + | "brandlightblue" + | "brandbrown" ; // Restrict backgroundColor to these options }) { // Dictionary to map background colors to hover colors const hoverColors = { @@ -38,6 +39,7 @@ export function BrandButton({ brandgold: "hover:bg-hovergold", brandmidblue: "hover:bg-hoverblue", brandlightblue: "hover:bg-brandmidblue", + brandbrown: "hover:bg-brandbrown", }; return ( diff --git a/src/app/components/building-passport/EnergyEfficiencyImpactCard.tsx b/src/app/components/building-passport/EnergyEfficiencyImpactCard.tsx index 1ff4ff0..f250aca 100644 --- a/src/app/components/building-passport/EnergyEfficiencyImpactCard.tsx +++ b/src/app/components/building-passport/EnergyEfficiencyImpactCard.tsx @@ -14,41 +14,47 @@ export function EnergyEfficiencyImpactCard({ totalSapPoints, }: EnergyEfficiencyImpactCardProps) { return ( -
- - - - - +
Energy Efficiency Impact
+ + + + - - - - + {/* Divider row */} + + + - - - - + + + + - - - - - -
+ Energy Efficiency Impact +
Current EPC Rating: - {currentSapPoints + " " + currentEpcRating} -
+
+
Expected EPC Rating: - {Math.floor(expectedSapPoints) + " " + expectedEpcRating} -
Current EPC Rating: + {currentSapPoints} {currentEpcRating} +
- Total SAP Points Improvement: - - {Math.round((totalSapPoints + Number.EPSILON) * 100) / 100} -
-
+ + Expected EPC Rating: + + {Math.floor(expectedSapPoints)} {expectedEpcRating} + + + + + Total SAP Points Improvement: + + {Math.round((totalSapPoints + Number.EPSILON) * 100) / 100} + + + + ); } + interface SecondaryEnergyEfficiencyImpactCardProps { TotalCo2Savings: number; totalEnergyCostSavings: number; @@ -61,31 +67,39 @@ export function SecondaryEnergyEfficiencyImpactCard({ totalKwhSavings, }: SecondaryEnergyEfficiencyImpactCardProps) { return ( -
- - - - - +
+ + + + - - - - + {/* Divider row */} + + + - - - - + + + + - - - - - -
+ Gains +
- CO2 Reduction - {TotalCo2Savings.toFixed(1)}t
+
+
Energy Savings{totalKwhSavings.toFixed(0) + "kWh"}
+ CO2 Reduction + {TotalCo2Savings.toFixed(1)}t
Energy Bill Savings{"£" + Math.round(totalEnergyCostSavings)}
-
+ + Energy Savings + {totalKwhSavings.toFixed(0)}kWh + + + + Energy Bill Savings + £{Math.round(totalEnergyCostSavings)} + + + ); } + diff --git a/src/app/components/building-passport/RecommendationContainer.tsx b/src/app/components/building-passport/RecommendationContainer.tsx index d6c5bd8..6c3211b 100644 --- a/src/app/components/building-passport/RecommendationContainer.tsx +++ b/src/app/components/building-passport/RecommendationContainer.tsx @@ -18,11 +18,13 @@ import { EnergyEfficiencyImpactCard, SecondaryEnergyEfficiencyImpactCard, } from "./EnergyEfficiencyImpactCard"; +import { FundingPackageWithMeasures } from "@/app/db/schema/funding"; interface RecommendationContainerProps { recommendations: Recommendation[]; propertyMeta: PropertyMeta; planMeta: Plan; + funding: FundingPackageWithMeasures[] } const typeToCategoryMap: { [key in RecommendationType]?: RecommendationType } = @@ -54,6 +56,7 @@ export default function RecommendationContainer({ recommendations, propertyMeta, planMeta, + funding }: RecommendationContainerProps) { const categorizedRecommendations = recommendations.reduce((acc, curr) => { const typeKey = curr.type as RecommendationType; @@ -312,6 +315,13 @@ export default function RecommendationContainer({ sumRecommendationMetricMap(kwhSavingsMap) ); + // for the moment, we shouldn't have more than one funding package and so we flag if we have more than one + if (funding.length > 1) { + console.warn("Multiple funding packages found, using the first one."); + } + + const [totalFunding, setTotalFunding] = useState(funding[0].projectFunding) + const currentEpcRating = propertyMeta.currentEpcRating; const currentSapPoints = propertyMeta.currentSapPoints; @@ -326,6 +336,7 @@ export default function RecommendationContainer({
diff --git a/src/app/components/building-passport/ValuationImpactComponent.tsx b/src/app/components/building-passport/ValuationImpactComponent.tsx index 17ce12a..f5f797c 100644 --- a/src/app/components/building-passport/ValuationImpactComponent.tsx +++ b/src/app/components/building-passport/ValuationImpactComponent.tsx @@ -1,16 +1,67 @@ "use client"; -import { BrandButton } from "../Buttons"; import { useState } from "react"; +import React from 'react' +import { FundingPackageWithMeasures } from "@/app/db/schema/funding"; +import { formatNumber } from "@/app/utils"; +import {Card, CardContent} from "@/app/shadcn_components/ui/card"; +import { Button } from "@/app/shadcn_components/ui/button"; +import { PiggyBank } from 'lucide-react' + + +type FundingSummaryProps = { + scheme: string | null; + onSeeMore: () => void +} + +export const FundingSummary: React.FC = ({ scheme, onSeeMore }) => { + let message: string | null = null + + if (!scheme) { + message = 'Funding not assessed for this measure package' + } else if (scheme.toLowerCase() === 'none') { + message = 'Funding not eligible for this measure package' + } + + return ( + + + {message ? ( +

{message}

+ ) : ( + <> +
+ {scheme} + +
+

+ Click below to learn more about available funding options. +

+ + + )} +
+
+ ) +} export default function ValuationImpactComponent({ currentValuation, valuationIncreaseLowerBound, valuationIncreaseUpperBound, + funding, }: { currentValuation: number | null; valuationIncreaseLowerBound: number | null; valuationIncreaseUpperBound: number | null; + funding: FundingPackageWithMeasures; }) { const [fundingModalIsOpen, setFundingModalIsOpen] = useState(false); // If we have no current valuation, we return no component @@ -29,34 +80,28 @@ export default function ValuationImpactComponent({ return (
-
- Current Value - - £{currentValuation.toLocaleString()} +
+ Current Property Value + + £{formatNumber(currentValuation)}
-
+
After Retrofit Valuation -
- £{lowerBoundValuation.toLocaleString()} - £ - {upperBoundValuation.toLocaleString()} +
+ £{formatNumber(lowerBoundValuation)} - £{formatNumber(upperBoundValuation)}
- - Estimated improvement: £ - {valuationIncreaseLowerBound?.toLocaleString()} - £ - {valuationIncreaseUpperBound?.toLocaleString()} + Estimated improvement: + + £{formatNumber(valuationIncreaseLowerBound || 0)} - £{formatNumber(valuationIncreaseUpperBound || 0)}
-
- Funding Options - -
+
); } diff --git a/src/app/components/building-passport/WorksPackageCard.tsx b/src/app/components/building-passport/WorksPackageCard.tsx index a07fd40..902dcc0 100644 --- a/src/app/components/building-passport/WorksPackageCard.tsx +++ b/src/app/components/building-passport/WorksPackageCard.tsx @@ -4,32 +4,45 @@ import { convertDaysToWorkingWeeks, formatNumber } from "@/app/utils"; export default function WorksPackageCard({ totalEstimatedCost, totalLabourDays, + totalFunding, }: { totalEstimatedCost: number; totalLabourDays: number; + totalFunding: number | null; }) { return ( - +
- + + + + {/* Divider row */} + + - - + + - - + + - - + +
Works Package + Works Package +
+
+
Total Cost:{"£" + formatNumber(totalEstimatedCost)}Total Cost:{"£" + formatNumber(totalEstimatedCost)}
Trades required:{"1-2"}Total Funding:{"£" + formatNumber(totalFunding || 0)}
Estimated Duration:{convertDaysToWorkingWeeks(totalLabourDays)}Estimated Duration:{convertDaysToWorkingWeeks(totalLabourDays)}
); } + + diff --git a/src/app/db/schema/funding.ts b/src/app/db/schema/funding.ts index d3976e6..6924604 100644 --- a/src/app/db/schema/funding.ts +++ b/src/app/db/schema/funding.ts @@ -23,7 +23,7 @@ export const fundingPackage = pgTable("funding_package", { .references(() => plan.id), scheme: Scheme("scheme"), createdAt: timestamp("created_at").notNull().defaultNow(), - rojectFunding: real("project_funding"), + projectFunding: real("project_funding"), totalUplift: real("total_uplift"), fullProjectScore: real("full_project_score"), partialProjectScore: real("partial_project_score"), @@ -44,4 +44,9 @@ export const fundingPackageMeasures = pgTable("funding_package_measures", { }); -export type FundingPackage = typeof fundingPackage.$inferSelect; \ No newline at end of file +export type FundingPackage = typeof fundingPackage.$inferSelect; +export type FundingPackageMeasure = typeof fundingPackageMeasures.$inferSelect; + +export type FundingPackageWithMeasures = FundingPackage & { + fundingPackageMeasures: FundingPackageMeasure[]; +}; \ No newline at end of file diff --git a/src/app/db/schema/relations.ts b/src/app/db/schema/relations.ts index 87e7d4c..d21ebff 100644 --- a/src/app/db/schema/relations.ts +++ b/src/app/db/schema/relations.ts @@ -1,8 +1,8 @@ +// This script contains ALL relations for the database, used by drizzle-orm import { energyAssessmentDocuments, energyAssessmentScenarios, } from "./energy_assessments"; -// This script contains ALL relations for the database, used by drizzle-orm import { relations } from "drizzle-orm"; import { @@ -21,6 +21,7 @@ import { import { material } from "./materials"; import { portfolio, portfolioUsers } from "./portfolio"; import { user } from "./users"; +import { fundingPackage, fundingPackageMeasures } from "./funding"; // Define the other side of the one to many relation between a property and its recomendations export const recommendationsRelations = relations( @@ -154,3 +155,19 @@ export const energyAssessmentDocumentsRelations = relations( }), }) ); + +// Relation from a funding package to funding package measures +// Define a relation from a EnergyAssessmentDocument to EnergyAssessmentScenario. This is a many to one + +// funding package links to multiple funding package measures +export const fundingPackageRelations = relations(fundingPackage, ({ many }) => ({ + fundingPackageMeasures: many(fundingPackageMeasures), +})); + +// funding package measures belong to a funding package +export const fundingPackageMeasuresRelations = relations(fundingPackageMeasures, ({ one }) => ({ + fundingPackage: one(fundingPackage, { + fields: [fundingPackageMeasures.fundingPackageId], + references: [fundingPackage.id], + }), +})); diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx index 05efebb..a51eee2 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx @@ -21,6 +21,7 @@ export default async function Recommendations( recommendations={recommendations} propertyMeta={propertyMeta} planMeta={planMeta} + funding={funding} />
); diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts b/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts index b5e11d8..d737e33 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/utils.ts @@ -26,16 +26,20 @@ import { } from "@/app/db/schema/energy_assessments"; import { fundingPackage, - FundingPackage + FundingPackage, + FundingPackageWithMeasures } from "@/app/db/schema/funding"; type RecommendationList = { recommendation: Recommendation; }[]; -export async function getPlanFunding(planId: string): Promise { +export async function getPlanFunding(planId: string): Promise { const data = await db.query.fundingPackage.findMany({ where: eq(fundingPackage.planId, BigInt(planId)), + with: { + fundingPackageMeasures: true, + }, }); if (!data) { diff --git a/src/app/utils.ts b/src/app/utils.ts index 319ae0c..b2f3705 100644 --- a/src/app/utils.ts +++ b/src/app/utils.ts @@ -129,31 +129,29 @@ export function formatDateTime(dateTimeString: string | Date): string { } export function formatNumber(number: number): string { - if (number === 0) { - return "0"; - } + if (number === 0) return "0"; - const suffixes: string[] = ["", "k", "m", "b", "t"]; - const suffixIndex: number = Math.floor(Math.log10(Math.abs(number)) / 3); + const suffixes = ["", "k", "m", "b", "t"]; + const suffixIndex = Math.floor(Math.log10(Math.abs(number)) / 3); - // Check if the suffix index is within the available suffixes if (suffixIndex >= suffixes.length) { - return number.toString(); // Return the number as is + return number.toString(); } - // Check if the number is smaller and round to 2 decimal places - const roundedNumber: number = - Math.abs(number) < 1000 - ? Number(number.toFixed(1)) - : Number(number.toPrecision(4)); + const scaledNumber = number / Math.pow(1000, suffixIndex); - const formattedNumber: string = ( - roundedNumber / Math.pow(1000, suffixIndex) - ).toFixed(1); + // Format the number to one decimal place + let formatted = scaledNumber.toFixed(1); - return formattedNumber + suffixes[suffixIndex]; + // Remove trailing '.0' if present + if (formatted.endsWith(".0")) { + formatted = formatted.slice(0, -2); + } + + return formatted + suffixes[suffixIndex]; } + export function roundToDecimalPlaces( number: number, decimalPlaces: number From 05438a8f4462d847a00e31fe36b5a50920cf897f Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 21 Aug 2025 22:07:37 +0000 Subject: [PATCH 07/10] added the funding modal --- .../building-passport/RecommendationCard.tsx | 12 +- .../RecommendationContainer.tsx | 4 +- .../ValuationImpactComponent.tsx | 109 ++++++++++++++++-- .../[propertyId]/plans/[planId]/page.tsx | 3 +- 4 files changed, 106 insertions(+), 22 deletions(-) diff --git a/src/app/components/building-passport/RecommendationCard.tsx b/src/app/components/building-passport/RecommendationCard.tsx index 4633e38..c331321 100644 --- a/src/app/components/building-passport/RecommendationCard.tsx +++ b/src/app/components/building-passport/RecommendationCard.tsx @@ -136,7 +136,7 @@ export default function RecommendationCard({ const optionTextClassName = alreadyInstalled ? "text-brandgold" - : "text-blue-500 hover:text-blue-300"; + : "text-brandbrown hover:text-blue-300"; const optionsText = alreadyInstalled ? "Already installed" @@ -173,22 +173,16 @@ export default function RecommendationCard({ Estimated Cost: - + {cardComponent ? "£" + formatNumber(cardComponent?.estimatedCost || 0) : ""} - {cardComponent.newUValue && ( - - New U-Value: - {cardComponent.newUValue} - - )} {cardComponent.sapPoints != null && ( SAP Points: - + {cardComponent.sapPoints < 0.1 && cardComponent.type !== "mechanical_ventilation" ? "Negligible" diff --git a/src/app/components/building-passport/RecommendationContainer.tsx b/src/app/components/building-passport/RecommendationContainer.tsx index 6c3211b..af9dc11 100644 --- a/src/app/components/building-passport/RecommendationContainer.tsx +++ b/src/app/components/building-passport/RecommendationContainer.tsx @@ -332,7 +332,7 @@ export default function RecommendationContainer({ return ( <> -
+
- +
{Object.entries(categorizedRecommendations).map( diff --git a/src/app/components/building-passport/ValuationImpactComponent.tsx b/src/app/components/building-passport/ValuationImpactComponent.tsx index f5f797c..f1856a0 100644 --- a/src/app/components/building-passport/ValuationImpactComponent.tsx +++ b/src/app/components/building-passport/ValuationImpactComponent.tsx @@ -7,6 +7,10 @@ import { formatNumber } from "@/app/utils"; import {Card, CardContent} from "@/app/shadcn_components/ui/card"; import { Button } from "@/app/shadcn_components/ui/button"; import { PiggyBank } from 'lucide-react' +import { Dialog, Transition } from '@headlessui/react' +import { Fragment } from 'react' +import { FundingPackageMeasure } from "@/app/db/schema/funding"; +import { set } from "cypress/types/lodash"; type FundingSummaryProps = { @@ -27,7 +31,7 @@ export const FundingSummary: React.FC = ({ scheme, onSeeMor {message ? ( -

{message}

+

{message}

) : ( <>
@@ -37,14 +41,16 @@ export const FundingSummary: React.FC = ({ scheme, onSeeMor

Click below to learn more about available funding options.

- + {!message && ( + + )} )} @@ -102,6 +108,91 @@ export default function ValuationImpactComponent({ scheme={funding.scheme} onSeeMore={openFundingModal} /> + setFundingModalIsOpen(false)} + scheme={funding.scheme} + fundingPackageMeasures={funding.fundingPackageMeasures} + />
); } + + +type FundingSummaryModalProps = { + isOpen: boolean + closeModal: () => void + scheme?: string | null; + fundingPackageMeasures: FundingPackageMeasure[] +} + +export function FundingSummaryModal({ + isOpen, + closeModal, + scheme, + fundingPackageMeasures, +}: FundingSummaryModalProps) { + return ( + + + +
+ + +
+
+ + + + + {scheme?.toUpperCase() || 'Funding Details'} + + +

+ This package has been optimised to meet the eligibility criteria of the {scheme?.toUpperCase()} funding scheme. Measures have been selected to maximise the property’s improvement while minimising cost and ensuring compliance. +

+ +
+

Included Measures

+
    + {fundingPackageMeasures.map((measure) => ( +
  • + {measure.measure.replace(/_/g, ' ')} +
  • + ))} +
+
+ +
+ +
+
+
+
+
+
+
+ ) +} diff --git a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx index a51eee2..3c270be 100644 --- a/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx +++ b/src/app/portfolio/[slug]/building-passport/[propertyId]/plans/[planId]/page.tsx @@ -12,11 +12,10 @@ export default async function Recommendations( const planMeta = await getPlanMeta(params.planId); const funding = await getPlanFunding(params.planId); - console.log("Funding Data:", funding); + console.log(funding) return (
-
Recommendations
Date: Thu, 21 Aug 2025 23:06:12 +0000 Subject: [PATCH 08/10] fixed build --- src/app/components/portfolio/SummaryBox.tsx | 59 +++++++++++++++---- src/app/db/schema/recommendations.ts | 4 +- src/app/portfolio/[slug]/(portfolio)/page.tsx | 4 ++ src/app/portfolio/[slug]/utils.ts | 7 ++- 4 files changed, 58 insertions(+), 16 deletions(-) diff --git a/src/app/components/portfolio/SummaryBox.tsx b/src/app/components/portfolio/SummaryBox.tsx index c92cebb..5c6b949 100644 --- a/src/app/components/portfolio/SummaryBox.tsx +++ b/src/app/components/portfolio/SummaryBox.tsx @@ -1,6 +1,7 @@ "use client"; import { useState } from "react"; -import { convertDaysToWorkingWeeks, formatNumber } from "@/app/utils"; +import { formatNumber } from "@/app/utils"; + interface SummaryBoxProps { scenarios: Array<{ @@ -8,6 +9,8 @@ interface SummaryBoxProps { name: string; budget: number | null; totalCost: number | null; + funding: number | null; + contingency: number | null; co2EquivalentSavings: number | null; propertyValuationIncrease: number | null; energySavings: number | null; @@ -33,6 +36,15 @@ function SummaryBox({ scenarios, numProperties }: SummaryBoxProps) { const [totalCostFormatted, setTotalCostFormatted] = useState( formatMoney(defaultScenario.totalCost) ); + const [funding, setFunding] = useState( + formatMoney(defaultScenario.funding) + ); + const [netCost, setNetCost] = useState( + formatMoney((defaultScenario.totalCost || 0) - (defaultScenario.funding || 0)) + ); + const [contingency, setContingency] = useState( + formatMoney(defaultScenario.contingency) + ); const [totalValueIncreaseFormatted, setTotalValueIncreaseFormatted] = useState(formatMoney(defaultScenario.propertyValuationIncrease)); const [energyCostSavingsFormatted, setEnergyCostSavingsFormatted] = useState( @@ -56,6 +68,13 @@ function SummaryBox({ scenarios, numProperties }: SummaryBoxProps) { setBudgetFormatted(formatBudget(selectedScenario.budget)); setTotalCostFormatted(formatMoney(selectedScenario.totalCost)); + setFunding(formatMoney(selectedScenario.funding)); + setNetCost( + formatMoney( + (selectedScenario.totalCost || 0) - (selectedScenario.funding || 0) + ) + ); + setContingency(formatMoney(selectedScenario.contingency)); setTotalValueIncreaseFormatted( formatMoney(selectedScenario.propertyValuationIncrease) ); @@ -119,18 +138,36 @@ function SummaryBox({ scenarios, numProperties }: SummaryBoxProps) { - - + + - - + + + + + + + + + + + + + - +
Total Budget{budgetFormatted}Budget{budgetFormatted}
Total Cost + Cost {totalCostFormatted}
Funding + {funding} +
Cost after funding + {netCost} +
Contingency + {contingency} +
Total properties{numProperties}{numProperties}
@@ -149,13 +186,13 @@ function SummaryBox({ scenarios, numProperties }: SummaryBoxProps) { {" "} Savings - + {co2EquivalentSavingsFormatted} Annual Energy Savings - + {energySavingsFormatted} @@ -164,19 +201,19 @@ function SummaryBox({ scenarios, numProperties }: SummaryBoxProps) {

- Financial Impact + Bills and Property Valuation

- - diff --git a/src/app/db/schema/recommendations.ts b/src/app/db/schema/recommendations.ts index e05f2e5..f27908f 100644 --- a/src/app/db/schema/recommendations.ts +++ b/src/app/db/schema/recommendations.ts @@ -199,7 +199,7 @@ export type RecommendationType = | "extension_cavity_wall_insulation"; export type UnnestedRecommendation = { - quantity: number; + quantity: number | null; quantityUnit: string | null; estimatedCost: number; materialType: string | null; @@ -209,7 +209,7 @@ export type UnnestedRecommendation = { }; export interface PortfolioPlanRecommendation { - quantity: number; + quantity: number | null; // Allow null for cases where no materials are associated quantityUnit: string | null; estimatedCost: number; materialType: string | null; diff --git a/src/app/portfolio/[slug]/(portfolio)/page.tsx b/src/app/portfolio/[slug]/(portfolio)/page.tsx index 1f12123..03d0425 100644 --- a/src/app/portfolio/[slug]/(portfolio)/page.tsx +++ b/src/app/portfolio/[slug]/(portfolio)/page.tsx @@ -44,6 +44,8 @@ export default async function Page( name: performance.name || "Default Scenario", budget: performance.budget, totalCost: performance.cost, + funding: performance.funding, + contingency: performance.contingency, co2EquivalentSavings: performance.co2EquivalentSavings, propertyValuationIncrease: performance.propertyValuationIncrease, energySavings: performance.energySavings, @@ -59,6 +61,8 @@ export default async function Page( name: "Default", budget: portfolio.budget, totalCost: portfolio.cost, + funding: 0, + contingency: 0, co2EquivalentSavings: portfolio.co2EquivalentSavings, propertyValuationIncrease: portfolio.propertyValuationIncrease, energySavings: portfolio.energySavings, diff --git a/src/app/portfolio/[slug]/utils.ts b/src/app/portfolio/[slug]/utils.ts index 40a4e4b..545f7ac 100644 --- a/src/app/portfolio/[slug]/utils.ts +++ b/src/app/portfolio/[slug]/utils.ts @@ -460,7 +460,7 @@ export async function getProperties( } interface UnaggregatedPortfolioPlanRecommendation { - quantity: number; + quantity: number | null; // Allow null for cases where no materials are associated quantityUnit: string | null; estimatedCost: number; materialType: string | null; @@ -496,7 +496,8 @@ function aggregateRecommendations( : new Set(), }; } else { - grouped[key].quantity += item.quantity; + // if quantity is null previously, set to 0 + grouped[key].quantity = (grouped[key].quantity ?? 0) + (item.quantity ?? 0); grouped[key].estimatedCost += item.estimatedCost; if (item.propertyId) { @@ -511,7 +512,7 @@ function aggregateRecommendations( // Round the results to 2 decimal places, compute uniquePropertyCount, and count unique measureTypes for (const key in grouped) { - grouped[key].quantity = parseFloat(grouped[key].quantity.toFixed(2)); + grouped[key].quantity = parseFloat(grouped[key].quantity?.toFixed(2) || "0.00"); grouped[key].estimatedCost = parseFloat( grouped[key].estimatedCost.toFixed(2) ); From f18b819992c7f54280d17403f8b3fa086c293838 Mon Sep 17 00:00:00 2001 From: Khalim Conn-Kowlessar Date: Thu, 21 Aug 2025 23:40:05 +0000 Subject: [PATCH 09/10] added additional summary metrics --- .../portfolio/scenario/[scenarioId]/route.ts | 30 +++++++++- .../portfolio/summary/SummaryTable.tsx | 2 +- .../[slug]/(portfolio)/summary/page.tsx | 2 + src/app/portfolio/[slug]/utils.ts | 56 +++++++++++++++++-- 4 files changed, 83 insertions(+), 7 deletions(-) diff --git a/src/app/api/portfolio/scenario/[scenarioId]/route.ts b/src/app/api/portfolio/scenario/[scenarioId]/route.ts index 2e3c4aa..085b5f4 100644 --- a/src/app/api/portfolio/scenario/[scenarioId]/route.ts +++ b/src/app/api/portfolio/scenario/[scenarioId]/route.ts @@ -14,6 +14,8 @@ export async function GET(request: NextRequest, props: { params: Promise<{ scena .select({ name: scenario.name, cost: scenario.cost, + funding: scenario.funding, + contingency: scenario.contingency, epcBreakdownPostRetrofit: scenario.epcBreakdownPostRetrofit, numberOfProperties: scenario.numberOfProperties, nUnitsToRetrofit: scenario.nUnitsToRetrofit, @@ -99,7 +101,7 @@ export async function GET(request: NextRequest, props: { params: Promise<{ scena ], }, { - title: "Cost (£)", + title: "Cost of works (£)", scenarios: [ { scenarioName: scenarioName, @@ -108,10 +110,34 @@ export async function GET(request: NextRequest, props: { params: Promise<{ scena ], }, { - title: "Cost (£)/unit", + title: "Cost of works (£)/unit", scenarios: [ { scenarioName: scenarioName, data: data[0].costPerUnit || "" }, ], + }, + { + title: "Funding (£)", + scenarios: [ + { scenarioName: scenarioName, data: "£" + formatNumber(data[0].funding || 0) }, + ], + }, + { + title: "Funding (£)/unit", + scenarios: [ + { scenarioName: scenarioName, data: "£" + formatNumber((data[0].funding || 0) / (data[0].nUnitsToRetrofit || 1)) }, + ], + }, + { + title: "Contingency (£)", + scenarios: [ + { scenarioName: scenarioName, data: "£" + formatNumber(data[0].contingency || 0) }, + ], + }, + { + title: "Contingency (£)/unit", + scenarios: [ + { scenarioName: scenarioName, data: "£" + formatNumber((data[0].contingency || 0) / (data[0].nUnitsToRetrofit || 1)) }, + ], }, { title: "£ per CO2 reduction", diff --git a/src/app/components/portfolio/summary/SummaryTable.tsx b/src/app/components/portfolio/summary/SummaryTable.tsx index b60a499..14c90bf 100644 --- a/src/app/components/portfolio/summary/SummaryTable.tsx +++ b/src/app/components/portfolio/summary/SummaryTable.tsx @@ -184,7 +184,7 @@ const SummaryTable = ({
Annual Energy Bill Reduction + {energyCostSavingsFormatted}
Total Value Increase + {totalValueIncreaseFormatted}