drizzle implemented
This commit is contained in:
1 parent
cdd854bd70
commit
670e6675cc
21 files changed
+1863
-904
No files matched your search
@@ -12,4 +12,4 @@ const sqlite = new Database(dbPath)
|
||||
export const db = drizzle(sqlite, { schema })
|
||||
|
||||
export * from './schema'
|
||||
export { eq, and, or, desc, asc } from 'drizzle-orm'
|
||||
export { eq, and, or, desc, asc, sql } from 'drizzle-orm'
|
||||
@@ -74,9 +74,9 @@ export const payments = sqliteTable("payments", {
|
||||
|
||||
export const attendance = sqliteTable("attendance", {
|
||||
id: text("id").primaryKey(),
|
||||
clientId: text("client_id")
|
||||
userId: text("user_id")
|
||||
.notNull()
|
||||
.references(() => clients.id, { onDelete: "cascade" }),
|
||||
.references(() => users.id, { onDelete: "cascade" }),
|
||||
checkInTime: integer("check_in_time", { mode: "timestamp" }).notNull(),
|
||||
checkOutTime: integer("check_out_time", { mode: "timestamp" }),
|
||||
type: text("type", { enum: ["gym", "class", "personal_training"] })
|
||||
@@ -116,15 +116,7 @@ export const fitnessProfiles = sqliteTable("fitness_profiles", {
|
||||
gender: text("gender", {
|
||||
enum: ["male", "female", "other", "prefer_not_to_say"],
|
||||
}),
|
||||
fitnessGoal: text("fitness_goal", {
|
||||
enum: [
|
||||
"weight_loss",
|
||||
"muscle_gain",
|
||||
"endurance",
|
||||
"flexibility",
|
||||
"general_fitness",
|
||||
],
|
||||
}),
|
||||
fitnessGoals: text("fitness_goals", { mode: "json" }).$type<string[]>(),
|
||||
activityLevel: text("activity_level", {
|
||||
enum: [
|
||||
"sedentary",
|
||||
|
||||
Reference in new issue
Block a user