Introduced New DB

This commit is contained in:
2025-12-06 10:34:58 +01:00
parent 407592680a
commit 63af22b671
80 changed files with 4509 additions and 154 deletions

View File

@@ -0,0 +1,35 @@
import {
pgTable,
bigint,
timestamp,
text,
} from "drizzle-orm/pg-core"
import { tenants } from "./tenants"
export const generatedexports = pgTable("exports", {
id: bigint("id", { mode: "number" })
.primaryKey()
.generatedByDefaultAsIdentity(),
createdAt: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
tenantId: bigint("tenant_id", { mode: "number" })
.notNull()
.references(() => tenants.id),
startDate: timestamp("start_date", { withTimezone: true }).notNull(),
endDate: timestamp("end_date", { withTimezone: true }).notNull(),
validUntil: timestamp("valid_until", { withTimezone: true }),
type: text("type").notNull().default("datev"),
url: text("url").notNull(),
filePath: text("file_path"),
})
export type Export = typeof generatedexports.$inferSelect
export type NewExport = typeof generatedexports.$inferInsert