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() .notNull(), }, (table) => [ uniqueIndex("external_csv_configurations_project_id_unique").on( table.projectId ), ] );