23 lines
976 B
TypeScript
23 lines
976 B
TypeScript
import { sql } from "drizzle-orm";
|
|
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
|
|
import type { DistributionBoardSupplyType } from "../../shared/constants/distribution-board.js";
|
|
|
|
export const projects = sqliteTable("projects", {
|
|
id: text("id").primaryKey(),
|
|
name: text("name").notNull(),
|
|
internalProjectNumber: text("internal_project_number"),
|
|
externalProjectNumber: text("external_project_number"),
|
|
buildingOwner: text("building_owner"),
|
|
description: text("description"),
|
|
singlePhaseVoltageV: integer("single_phase_voltage_v").notNull().default(230),
|
|
threePhaseVoltageV: integer("three_phase_voltage_v").notNull().default(400),
|
|
enabledDistributionBoardSupplyTypes: text(
|
|
"enabled_distribution_board_supply_types",
|
|
{ mode: "json" }
|
|
)
|
|
.$type<DistributionBoardSupplyType[]>()
|
|
.notNull()
|
|
.default(sql`'["AV","SV","EV","USV","MSR","SiBe"]'`),
|
|
currentRevision: integer("current_revision").notNull().default(0),
|
|
});
|