Phase 1A done

This commit is contained in:
2026-05-03 21:16:52 +02:00
parent 49190c5d7e
commit b8995b3a1b
21 changed files with 1038 additions and 3 deletions
+21
View File
@@ -0,0 +1,21 @@
import { integer, sqliteTable, text, unique } from "drizzle-orm/sqlite-core";
import { circuitLists } from "./circuit-lists.js";
export const circuitSections = sqliteTable(
"circuit_sections",
{
id: text("id").primaryKey(),
circuitListId: text("circuit_list_id")
.notNull()
.references(() => circuitLists.id, { onDelete: "cascade" }),
key: text("key").notNull(),
displayName: text("display_name").notNull(),
prefix: text("prefix").notNull(),
sortOrder: integer("sort_order").notNull().default(0),
},
(table) => [
unique("circuit_sections_list_key_unique").on(table.circuitListId, table.key),
unique("circuit_sections_list_prefix_unique").on(table.circuitListId, table.prefix),
]
);