migrations

This commit is contained in:
Khalim Conn-Kowlessar 2025-08-22 01:27:36 +00:00
parent f18b819992
commit 47a1bbd7ef
7 changed files with 6764 additions and 2 deletions

View file

@ -31,8 +31,9 @@ export async function POST(request: NextRequest) {
secretAccessKey: process.env.PRESIGN_AWS_SECRET_KEY,
});
const { userId, portfolioId, fileKey } = validatedBody;
const { fileKey } = validatedBody;
console.log("Making presigned URL")
// Presigned url is valid for 5 minutes
const preSignedUrl = await s3.getSignedUrl("putObject", {
Bucket: process.env.RETROFIT_PLAN_INPUT_BUCKET_NAME,
@ -40,6 +41,7 @@ export async function POST(request: NextRequest) {
ContentType: "text/csv",
Expires: 5 * 60,
});
console.log("preSignedUrl:", preSignedUrl)
return new NextResponse(JSON.stringify({ url: preSignedUrl }), {
status: 200,

View file

@ -0,0 +1,6 @@
ALTER TABLE "funding_package_measures" ALTER COLUMN "measure" SET DATA TYPE text;--> statement-breakpoint
ALTER TABLE "material" ALTER COLUMN "type" SET DATA TYPE text;--> statement-breakpoint
DROP TYPE "public"."type";--> statement-breakpoint
CREATE TYPE "public"."type" AS ENUM('suspended_floor_insulation', 'solid_floor_insulation', 'external_wall_insulation', 'internal_wall_insulation', 'cavity_wall_insulation', 'mechanical_ventilation', 'loft_insulation', 'exposed_floor_insulation', 'flat_roof_insulation', 'room_roof_insulation', 'cavity_wall_extraction', 'iwi_wall_demolition', 'iwi_vapour_barrier', 'iwi_redecoration', 'suspended_floor_demolition', 'suspended_floor_redecoration', 'suspended_floor_vapour_barrier', 'solid_floor_demolition', 'solid_floor_preparation', 'solid_floor_vapour_barrier', 'solid_floor_redecoration', 'ewi_wall_demolition', 'ewi_wall_preparation', 'ewi_wall_redecoration', 'low_energy_lighting_installation', 'flat_roof_preparation', 'flat_roof_vapour_barrier', 'flat_roof_waterproofing', 'windows_glazing', 'trickle_vent', 'door_undercut', 'solar_pv', 'solar_battery', 'scaffolding', 'high_heat_retention_storage_heaters', 'air_source_heat_pump', 'sealing_open_fireplace');--> statement-breakpoint
ALTER TABLE "funding_package_measures" ALTER COLUMN "measure" SET DATA TYPE "public"."type" USING "measure"::"public"."type";--> statement-breakpoint
ALTER TABLE "material" ALTER COLUMN "type" SET DATA TYPE "public"."type" USING "type"::"public"."type";

View file

@ -0,0 +1,6 @@
ALTER TABLE "funding_package_measures" ALTER COLUMN "measure" SET DATA TYPE text;--> statement-breakpoint
ALTER TABLE "material" ALTER COLUMN "type" SET DATA TYPE text;--> statement-breakpoint
DROP TYPE "public"."type";--> statement-breakpoint
CREATE TYPE "public"."type" AS ENUM('suspended_floor_insulation', 'solid_floor_insulation', 'external_wall_insulation', 'internal_wall_insulation', 'cavity_wall_insulation', 'mechanical_ventilation', 'loft_insulation', 'exposed_floor_insulation', 'flat_roof_insulation', 'room_roof_insulation', 'cavity_wall_extraction', 'iwi_wall_demolition', 'iwi_vapour_barrier', 'iwi_redecoration', 'suspended_floor_demolition', 'suspended_floor_redecoration', 'suspended_floor_vapour_barrier', 'solid_floor_demolition', 'solid_floor_preparation', 'solid_floor_vapour_barrier', 'solid_floor_redecoration', 'ewi_wall_demolition', 'ewi_wall_preparation', 'ewi_wall_redecoration', 'low_energy_lighting_installation', 'flat_roof_preparation', 'flat_roof_vapour_barrier', 'flat_roof_waterproofing', 'windows_glazing', 'trickle_vent', 'door_undercut', 'solar_pv', 'solar_battery', 'scaffolding', 'high_heat_retention_storage_heaters', 'air_source_heat_pump', 'sealing_fireplace');--> statement-breakpoint
ALTER TABLE "funding_package_measures" ALTER COLUMN "measure" SET DATA TYPE "public"."type" USING "measure"::"public"."type";--> statement-breakpoint
ALTER TABLE "material" ALTER COLUMN "type" SET DATA TYPE "public"."type" USING "type"::"public"."type";

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -799,6 +799,20 @@
"when": 1755798209029,
"tag": "0113_bright_lady_bullseye",
"breakpoints": true
},
{
"idx": 114,
"version": "7",
"when": 1755825706741,
"tag": "0114_swift_unicorn",
"breakpoints": true
},
{
"idx": 115,
"version": "7",
"when": 1755826015743,
"tag": "0115_skinny_makkari",
"breakpoints": true
}
]
}

View file

@ -54,7 +54,7 @@ export const MaterialType: [string, ...string[]] = [
"high_heat_retention_storage_heaters",
"air_source_heat_pump",
// other
"sealing_fireplace"
"sealing_fireplace",
];
export const materialTypeEnum = pgEnum("type", MaterialType);