mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
Migrating database to add new columns for new materials
This commit is contained in:
parent
84eecd1b2c
commit
9c44e6b7ca
8 changed files with 2678 additions and 7 deletions
1
src/app/db/migrations/0045_happy_mister_sinister.sql
Normal file
1
src/app/db/migrations/0045_happy_mister_sinister.sql
Normal file
|
|
@ -0,0 +1 @@
|
|||
ALTER TABLE "material" RENAME COLUMN "depths" TO "depth";
|
||||
6
src/app/db/migrations/0046_lonely_jack_flag.sql
Normal file
6
src/app/db/migrations/0046_lonely_jack_flag.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
ALTER TABLE "material" ADD COLUMN "prime_material_cost" real;--> statement-breakpoint
|
||||
ALTER TABLE "material" ADD COLUMN "material_cost" real;--> statement-breakpoint
|
||||
ALTER TABLE "material" ADD COLUMN "labour_cost" real;--> statement-breakpoint
|
||||
ALTER TABLE "material" ADD COLUMN "labour_cost_per_unit" real;--> statement-breakpoint
|
||||
ALTER TABLE "material" ADD COLUMN "plant_cost" real;--> statement-breakpoint
|
||||
ALTER TABLE "material" ADD COLUMN "total_cost" real;
|
||||
1306
src/app/db/migrations/meta/0045_snapshot.json
Normal file
1306
src/app/db/migrations/meta/0045_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
1340
src/app/db/migrations/meta/0046_snapshot.json
Normal file
1340
src/app/db/migrations/meta/0046_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -316,6 +316,20 @@
|
|||
"when": 1700490618083,
|
||||
"tag": "0044_huge_shocker",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 45,
|
||||
"version": "5",
|
||||
"when": 1700757832683,
|
||||
"tag": "0045_happy_mister_sinister",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 46,
|
||||
"version": "5",
|
||||
"when": 1700757960766,
|
||||
"tag": "0046_lonely_jack_flag",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -46,9 +46,9 @@ export const material = pgTable("material", {
|
|||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
type: materialTypeEnum("type").notNull(),
|
||||
description: text("description").notNull(),
|
||||
depths: json("depths").$type<number[]>(),
|
||||
depth: json("depth").$type<number[]>(),
|
||||
depth_unit: depthUnitEnum("depth_unit"),
|
||||
cost: json("cost").$type<number[]>(),
|
||||
|
||||
costUnit: costUnitEnum("cost_unit"),
|
||||
rValuePerMm: real("r_value_per_mm"),
|
||||
rValueUnit: rValueUnitEnum("r_value_unit"),
|
||||
|
|
@ -59,4 +59,11 @@ export const material = pgTable("material", {
|
|||
link: text("link"),
|
||||
createdAt: timestamp("created_at").notNull().defaultNow(),
|
||||
isActive: boolean("is_active").notNull().default(true),
|
||||
prime_material_cost: real("prime_material_cost"),
|
||||
material_cost: real("material_cost"),
|
||||
labour_cost: real("labour_cost"),
|
||||
labour_cost_per_unit: real("labour_cost_per_unit"),
|
||||
plant_cost: real("plant_cost"),
|
||||
total_cost: real("total_cost"),
|
||||
cost: json("cost").$type<number[]>(),
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,9 +10,6 @@ export default async function PortfolioPlan({
|
|||
const portfolioId = params.slug;
|
||||
const portfolioPlan = await getPortfolioPlan(portfolioId);
|
||||
|
||||
console.log("HIHI");
|
||||
console.log(portfolioPlan);
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex justify-center mt-8">
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "es5",
|
||||
// "target": "ESNext",
|
||||
// "target": "es5",
|
||||
"target": "ESNext",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue