Schema Changes

This commit is contained in:
2025-12-06 19:29:28 +01:00
parent 63af22b671
commit 7450f90a0f
7 changed files with 55 additions and 55 deletions

View File

@@ -14,67 +14,67 @@ import { authUsers } from "./auth_users"
export const authProfiles = pgTable("auth_profiles", {
id: uuid("id").primaryKey().defaultRandom(),
userId: uuid("user_id").references(() => authUsers.id),
user_id: uuid("user_id").references(() => authUsers.id),
tenantId: bigint("tenant_id", { mode: "number" }).notNull(),
tenant_id: bigint("tenant_id", { mode: "number" }).notNull(),
createdAt: timestamp("created_at", { withTimezone: true })
created_at: timestamp("created_at", { withTimezone: true })
.notNull()
.defaultNow(),
firstName: text("first_name").notNull(),
lastName: text("last_name").notNull(),
first_name: text("first_name").notNull(),
last_name: text("last_name").notNull(),
fullName: text("full_name").generatedAlwaysAs(
full_name: text("full_name").generatedAlwaysAs(
`((first_name || ' ') || last_name)`
),
mobileTel: text("mobile_tel"),
fixedTel: text("fixed_tel"),
mobile_tel: text("mobile_tel"),
fixed_tel: text("fixed_tel"),
salutation: text("salutation"),
employeeNumber: text("employee_number"),
employee_number: text("employee_number"),
weeklyWorkingHours: doublePrecision("weekly_working_hours").default(0),
annualPaidLeaveDays: bigint("annual_paid_leave_days", { mode: "number" }),
weekly_working_hours: doublePrecision("weekly_working_hours").default(0),
annual_paid_leave_days: bigint("annual_paid_leave_days", { mode: "number" }),
weeklyRegularWorkingHours: jsonb("weekly_regular_working_hours").default("{}"),
weekly_regular_working_hours: jsonb("weekly_regular_working_hours").default("{}"),
clothingSizeTop: text("clothing_size_top"),
clothingSizeBottom: text("clothing_size_bottom"),
clothingSizeShoe: text("clothing_size_shoe"),
clothing_size_top: text("clothing_size_top"),
clothing_size_bottom: text("clothing_size_bottom"),
clothing_size_shoe: text("clothing_size_shoe"),
emailSignature: text("email_signature").default("<p>Mit freundlichen Grüßen</p>"),
email_signature: text("email_signature").default("<p>Mit freundlichen Grüßen</p>"),
birthday: date("birthday"),
entryDate: date("entry_date").defaultNow(),
entry_date: date("entry_date").defaultNow(),
automaticHourCorrections: jsonb("automatic_hour_corrections").default("[]"),
automatic_hour_corrections: jsonb("automatic_hour_corrections").default("[]"),
recreationDaysCompensation: boolean("recreation_days_compensation")
recreation_days_compensation: boolean("recreation_days_compensation")
.notNull()
.default(true),
customerForPortal: bigint("customer_for_portal", { mode: "number" }),
customer_for_portal: bigint("customer_for_portal", { mode: "number" }),
pinnedOnNavigation: jsonb("pinned_on_navigation").notNull().default("[]"),
pinned_on_navigation: jsonb("pinned_on_navigation").notNull().default("[]"),
email: text("email"),
tokenId: text("token_id"),
token_id: text("token_id"),
weeklyWorkingDays: doublePrecision("weekly_working_days"),
weekly_working_days: doublePrecision("weekly_working_days"),
oldProfileId: uuid("old_profile_id"),
tempConfig: jsonb("temp_config"),
old_profile_id: uuid("old_profile_id"),
temp_config: jsonb("temp_config"),
stateCode: text("state_code").default("DE-NI"),
state_code: text("state_code").default("DE-NI"),
contractType: text("contract_type"),
contract_type: text("contract_type"),
position: text("position"),
qualification: text("qualification"),
addressStreet: text("address_street"),
addressZip: text("address_zip"),
addressCity: text("address_city"),
address_street: text("address_street"),
address_zip: text("address_zip"),
address_city: text("address_city"),
active: boolean("active").notNull().default(true),
})