diff --git a/drizzle.config.ts b/drizzle.config.ts index 744be052..d0f4098d 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -3,11 +3,4 @@ import type { Config } from "drizzle-kit"; export default { schema: "./src/app/db/schema/*", out: "./src/app/db/migrations", - // dbCredentials: { - // host: String(process.env.DB_HOST), - // port: Number(process.env.DB_PORT), - // user: process.env.DB_USERNAME, - // password: process.env.DB_PASSWORD, - // database: String(process.env.DB_NAME), - // }, } satisfies Config; diff --git a/src/app/db/migrations/meta/_journal.json b/src/app/db/migrations/meta/_journal.json index 87b75960..bf117791 100644 --- a/src/app/db/migrations/meta/_journal.json +++ b/src/app/db/migrations/meta/_journal.json @@ -171,4 +171,4 @@ "breakpoints": true } ] -} \ No newline at end of file +} diff --git a/src/app/db/schema/materials.ts b/src/app/db/schema/materials.ts new file mode 100644 index 00000000..99dcccd3 --- /dev/null +++ b/src/app/db/schema/materials.ts @@ -0,0 +1,56 @@ +// TODO: Materials database should live in a different database + +// import { +// bigserial, +// text, +// timestamp, +// pgTable, +// real, +// pgEnum, +// json, +// } from "drizzle-orm/pg-core"; + +// export const MaterialType: [string, ...string[]] = [ +// "suspended_floor_insulation", +// "solid_floor_insulation", +// "external_wall_insulation", +// "internal_wall_insulation", +// ]; +// export const materialTypeEnum = pgEnum("type", MaterialType); + +// export const DepthUnit: [string, ...string[]] = ["mm"]; +// export const depthUnitEnum = pgEnum("depth_unit", DepthUnit); + +// export const CostUnit: [string, ...string[]] = ["gbp_sq_meter"]; +// export const costUnitEnum = pgEnum("cost_unit", CostUnit); + +// export const RValueUnit: [string, ...string[]] = [ +// "square_meter_kelvin_per_watt", +// ]; +// export const rValueUnitEnum = pgEnum("r_value_unit", RValueUnit); + +// export const ThermalConductivityUnit: [string, ...string[]] = [ +// "watt_per_meter_kelvin", +// ]; +// export const thermalConductivityUnitEnum = pgEnum( +// "thermal_conductivity_unit", +// ThermalConductivityUnit +// ); + +// export const materials = pgTable("property", { +// id: bigserial("id", { mode: "bigint" }).primaryKey(), +// type: materialTypeEnum("type").notNull(), +// description: text("description").notNull(), +// depths: json("json").$type(), +// depth_unit: depthUnitEnum("depth_unit"), +// cost: real("cost"), +// costUnit: costUnitEnum("cost_unit"), +// rValuePerMm: real("r_value_per_mm"), +// rValueUnit: rValueUnitEnum("r_value_unit"), +// thermalConductivity: real("thermal_conductivity"), +// thermalConductivityUnit: thermalConductivityUnitEnum( +// "thermal_conductivity_unit" +// ), +// link: text("link"), +// createdAt: timestamp("created_at").notNull().defaultNow(), +// });