forked from jappel/leistungsbilanz-ts
Persist Revit CSV configuration
This commit is contained in:
parent
da689af518
commit
219da5ec3b
22 changed files with 2508 additions and 27 deletions
22
src/db/schema/external-csv-configurations.ts
Normal file
22
src/db/schema/external-csv-configurations.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import { integer, sqliteTable, text, uniqueIndex } from "drizzle-orm/sqlite-core";
|
||||
import type { ExternalCsvConfiguration } from "../../external-model/csv/external-csv-contracts.js";
|
||||
import { projects } from "./projects.js";
|
||||
|
||||
export const externalCsvConfigurations = sqliteTable(
|
||||
"external_csv_configurations",
|
||||
{
|
||||
id: text("id").primaryKey(),
|
||||
projectId: text("project_id")
|
||||
.notNull()
|
||||
.references(() => projects.id, { onDelete: "cascade" }),
|
||||
configurationVersion: integer("configuration_version").notNull(),
|
||||
configuration: text("configuration", { mode: "json" })
|
||||
.$type<ExternalCsvConfiguration>()
|
||||
.notNull(),
|
||||
},
|
||||
(table) => [
|
||||
uniqueIndex("external_csv_configurations_project_id_unique").on(
|
||||
table.projectId
|
||||
),
|
||||
]
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue