diff --git a/drizzle.config.ts b/drizzle.config.ts index d0f4098d..67386592 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 44ff6c87..54533493 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 00000000..cbb26be2 --- /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 00000000..0310334e --- /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 00000000..5f312d28 --- /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 00000000..563b9825 --- /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 8c616631..fd727138 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 a1bdfa89..15e55e85 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 8ebb67b0..afb2c1a3 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 84cd0bf6..417a1f35 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 01e2ad75..9978f92a 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 38d510e8..90e725f9 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 931665bf..2f9b68f8 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 cf592614..0367e90d 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 81031672..31ca95d9 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 04c98a12..37e72987 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 e5f94ae4..5709ecc1 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 60327570..8d1c592e 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 ae287809..385b432d 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 f1ca5d78..2dad0c21 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 87df80c9..ded5be74 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 2f0b84cd..22aaa74d 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 4a9f5c3b..7ca53321 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 fe514731..409e1fa1 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 6d5cd661..9d691def 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 5e98fdd2..7e068bdc 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 6ac7861a..3c883242 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 64e24a58..7cd7c640 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 67fa35a8..8bdc1574 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 54e32417..32ddc6d5 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 41f265df..2fd3fde5 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 40027d4a..87bee609 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 81f8175a..22d43ad4 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 9dd20526..b6e43044 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 af50ac51..0c0aaafd 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 428474d2..95ea305b 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 42275035..bfc235d0 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 b4523a04..105f1f3a 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 d0930ea6..6684ac46 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 5981432f..9aa0a1c4 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 d7fb1432..bcc7602b 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 1cc6b1af..4c1d14ed 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 820b9ad7..837584b9 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 b2d5069a..14541cc1 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 4a702227..123ef2c0 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 4c8cc1e1..10d83347 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 6283ae4c..18583c2f 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 dfe4e543..bf73f6be 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 c5327ca4..e571ce5f 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 d3b53136..42907b55 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 daf70c46..e599592d 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 b1af5349..0890a1d3 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 46f12a15..90b0716d 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 428d26da..f162561b 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 fac1f7b5..ec50ce0a 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 3f375c14..cbe3b2cd 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 99ad07f3..7fbf8a59 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 1912ceba..3886d944 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 4378be4c..3edf42ee 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 71de1f40..03a128ee 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 cd1fb13f..dcfffe6d 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 c9c9ed32..7f64c634 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 fd39abf8..53a69426 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 7f737e2d..1dc66a38 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 aadd210a..dd23b185 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 0e46512d..05cb3b23 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 c0854391..98ab5483 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 768ac9b9..19c5fedf 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 6f5a315e..a319c154 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 d3f2ba12..1772f176 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 cc2c5b27..e65ec103 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 759772bc..42c173a0 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 556b374d..614799c6 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 c11a708e..7ed7b474 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 eca59b81..7b3308f1 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 5748e7b5..35a4d7ff 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 9974a33b..61e72a97 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 838ea307..378e6f20 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 9627d053..d24651de 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 084b8248..25e920a7 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 70d7d7a8..cbfb18e9 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 2d35093b..6670fa20 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 9b0558d2..2717c31d 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 a247ad96..c07e3af9 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 9cc758e7..bbb07699 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 a87cd5e5..3b5404fc 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 0e581256..ca746df2 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 8972258e..ac8c828b 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 e8fb250a..43e5630e 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 d097992c..24242c3a 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 6dfb08c0..2d6bbb1d 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 7e655109..c28a6e1c 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 2aa0f483..f2c5d46a 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 f829efac..6deaac34 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 aec3a0a4..a1a36b8b 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 689aae33..66ac2c67 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 36d2ab20..5e209339 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 3cf229d8..d2f127aa 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 501cb0aa..2950fe14 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 d45efdca..75d805ae 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 022ae877..7635dfec 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 7ef5617a..9bfd0bf1 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 aa2d4dff..2a44b283 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 3526c3c1..3bea8c3a 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 6771df01..760c8b50 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 383d069d..ad5b517a 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 312aeb21..d4606b4c 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 ad89845e..2e9db6a5 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 00000000..5c88c3f6 --- /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 00000000..44de2e7b --- /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 00000000..11fc06c0 --- /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 00000000..1f063642 --- /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 089797c8..e6087edc 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 cad5e334..ad1f2f4d 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;