import { real, sqliteTable, text } from "drizzle-orm/sqlite-core"; import { floors } from "./floors.js"; import { projects } from "./projects.js"; import type { DistributionBoardSupplyType } from "../../shared/constants/distribution-board.js"; export const distributionBoards = sqliteTable("distribution_boards", { id: text("id").primaryKey(), projectId: text("project_id") .notNull() .references(() => projects.id, { onDelete: "cascade" }), name: text("name").notNull(), floorId: text("floor_id").references(() => floors.id, { onDelete: "set null", }), supplyType: text("supply_type").$type(), simultaneityFactor: real("simultaneity_factor") .notNull() .default(1), boardNumber: text("board_number"), location: text("location"), fedFrom: text("fed_from"), remark: text("remark"), });