Introduced New DB
This commit is contained in:
44
db/schema/staff_zeitstromtimestamps.ts
Normal file
44
db/schema/staff_zeitstromtimestamps.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import {
|
||||
pgTable,
|
||||
uuid,
|
||||
timestamp,
|
||||
bigint,
|
||||
text,
|
||||
} from "drizzle-orm/pg-core"
|
||||
|
||||
import { tenants } from "./tenants"
|
||||
import { authProfiles } from "./auth_profiles"
|
||||
import { staffTimeEntries } from "./staff_time_entries"
|
||||
|
||||
export const staffZeitstromTimestamps = pgTable("staff_zeitstromtimestamps", {
|
||||
id: uuid("id").primaryKey().defaultRandom(),
|
||||
|
||||
createdAt: timestamp("created_at", { withTimezone: true })
|
||||
.notNull()
|
||||
.defaultNow(),
|
||||
|
||||
tenant: bigint("tenant", { mode: "number" })
|
||||
.notNull()
|
||||
.references(() => tenants.id),
|
||||
|
||||
profile: uuid("profile")
|
||||
.notNull()
|
||||
.references(() => authProfiles.id),
|
||||
|
||||
key: text("key").notNull(),
|
||||
|
||||
intent: text("intent").notNull(),
|
||||
|
||||
time: timestamp("time", { withTimezone: true }).notNull(),
|
||||
|
||||
staffTimeEntry: uuid("staff_time_entry").references(
|
||||
() => staffTimeEntries.id
|
||||
),
|
||||
|
||||
internalNote: text("internal_note"),
|
||||
})
|
||||
|
||||
export type StaffZeitstromTimestamp =
|
||||
typeof staffZeitstromTimestamps.$inferSelect
|
||||
export type NewStaffZeitstromTimestamp =
|
||||
typeof staffZeitstromTimestamps.$inferInsert
|
||||
Reference in New Issue
Block a user