All first todos completed

This commit is contained in:
2026-05-01 17:58:14 +02:00
parent 65819900b1
commit 18a4fdd893
29 changed files with 1263 additions and 160 deletions
+5
View File
@@ -1,6 +1,7 @@
import { integer, real, sqliteTable, text } from "drizzle-orm/sqlite-core";
import { circuitLists } from "./circuit-lists.js";
import { distributionBoards } from "./distribution-boards.js";
import { projectDevices } from "./project-devices.js";
import { projects } from "./projects.js";
import { rooms } from "./rooms.js";
@@ -15,6 +16,10 @@ export const consumers = sqliteTable("consumers", {
circuitListId: text("circuit_list_id").references(() => circuitLists.id, {
onDelete: "set null",
}),
projectDeviceId: text("project_device_id").references(() => projectDevices.id, {
onDelete: "set null",
}),
isLinkedToDevice: integer("is_linked_to_device").notNull().default(0),
roomId: text("room_id").references(() => rooms.id, {
onDelete: "set null",
}),
+1
View File
@@ -3,6 +3,7 @@ import { integer, real, sqliteTable, text } from "drizzle-orm/sqlite-core";
export const globalDevices = sqliteTable("global_devices", {
id: text("id").primaryKey(),
name: text("name").notNull(),
displayName: text("display_name").notNull(),
category: text("category"),
quantity: integer("quantity").notNull(),
installedPowerPerUnitKw: real("installed_power_per_unit_kw").notNull(),
+1
View File
@@ -7,6 +7,7 @@ export const projectDevices = sqliteTable("project_devices", {
.notNull()
.references(() => projects.id, { onDelete: "cascade" }),
name: text("name").notNull(),
displayName: text("display_name").notNull(),
category: text("category"),
quantity: integer("quantity").notNull(),
installedPowerPerUnitKw: real("installed_power_per_unit_kw").notNull(),