mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
funding migrations
This commit is contained in:
parent
c85d3956ce
commit
11d1605d5e
9 changed files with 10127 additions and 2 deletions
2
src/app/db/migrations/0111_eminent_red_wolf.sql
Normal file
2
src/app/db/migrations/0111_eminent_red_wolf.sql
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
CREATE TYPE "public"."scheme" AS ENUM('eco4', 'gbis', 'whlg', 'none');--> statement-breakpoint
|
||||
ALTER TABLE "funding_package" ALTER COLUMN "scheme" SET DATA TYPE "public"."scheme" USING "scheme"::text::"public"."scheme";
|
||||
1
src/app/db/migrations/0112_colossal_nightshade.sql
Normal file
1
src/app/db/migrations/0112_colossal_nightshade.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE "funding_package_measures" RENAME COLUMN "type" TO "measure";
|
||||
1
src/app/db/migrations/0113_bright_lady_bullseye.sql
Normal file
1
src/app/db/migrations/0113_bright_lady_bullseye.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TYPE "public"."type" ADD VALUE 'air_source_heat_pump' BEFORE 'sealing_fireplace';
|
||||
3366
src/app/db/migrations/meta/0111_snapshot.json
Normal file
3366
src/app/db/migrations/meta/0111_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
3366
src/app/db/migrations/meta/0112_snapshot.json
Normal file
3366
src/app/db/migrations/meta/0112_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
3367
src/app/db/migrations/meta/0113_snapshot.json
Normal file
3367
src/app/db/migrations/meta/0113_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -778,6 +778,27 @@
|
|||
"when": 1755789401931,
|
||||
"tag": "0110_colossal_hulk",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 111,
|
||||
"version": "7",
|
||||
"when": 1755794600885,
|
||||
"tag": "0111_eminent_red_wolf",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 112,
|
||||
"version": "7",
|
||||
"when": 1755795339728,
|
||||
"tag": "0112_colossal_nightshade",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 113,
|
||||
"version": "7",
|
||||
"when": 1755798209029,
|
||||
"tag": "0113_bright_lady_bullseye",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -12,7 +12,7 @@ import { material, materialTypeEnum } from "./materials"
|
|||
|
||||
|
||||
export const SchemeEnum: [string, ...string[]] = ["eco4", "gbis", "whlg", "none"];
|
||||
export const Scheme = pgEnum("depth_unit", SchemeEnum);
|
||||
export const Scheme = pgEnum("scheme", SchemeEnum);
|
||||
|
||||
// funding package table which has the aggregate level data for the funding package. A funding package will be
|
||||
// tied to a plan
|
||||
|
|
@ -35,7 +35,7 @@ export const fundingPackageMeasures = pgTable("funding_package_measures", {
|
|||
fundingPackageId: bigint("funding_package_id", { mode: "bigint" })
|
||||
.notNull()
|
||||
.references(() => fundingPackage.id),
|
||||
measure: materialTypeEnum("type").notNull(),
|
||||
measure: materialTypeEnum("measure").notNull(),
|
||||
materialId: bigint("material_id", { mode: "bigint" })
|
||||
.references(() => material.id), // May be null initially
|
||||
innovationUplift: real("innovation_uplift"),
|
||||
|
|
|
|||
|
|
@ -52,6 +52,7 @@ export const MaterialType: [string, ...string[]] = [
|
|||
"scaffolding",
|
||||
// heating systems
|
||||
"high_heat_retention_storage_heaters",
|
||||
"air_source_heat_pump",
|
||||
// other
|
||||
"sealing_fireplace"
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue