fitness profile

functionality added, need polishing
This commit is contained in:
dimitar committed 2025-11-11 02:16:29 +01:00
1 parent 64bc4aa58b
commit b9f33fdcc6
13 files changed
+1590 -7

No files matched your search

+6 -6
View File
@@ -1,10 +1,10 @@
import { defineConfig } from 'drizzle-kit'
import { defineConfig } from "drizzle-kit";
export default defineConfig({
schema: './src/schema.ts',
out: './drizzle',
driver: 'better-sqlite',
schema: "./src/schema.ts",
out: "./drizzle",
dialect: "sqlite",
dbCredentials: {
url: './fitai.db',
url: "./fitai.db",
},
})
});
Binary file not shown.
+43
View File
@@ -104,6 +104,47 @@ export const notifications = sqliteTable("notifications", {
.$defaultFn(() => new Date()),
});
export const fitnessProfiles = sqliteTable("fitness_profiles", {
id: text("id").primaryKey(),
userId: text("user_id")
.notNull()
.unique()
.references(() => users.id, { onDelete: "cascade" }),
height: real("height"), // in cm
weight: real("weight"), // in kg
age: integer("age"),
gender: text("gender", {
enum: ["male", "female", "other", "prefer_not_to_say"],
}),
fitnessGoal: text("fitness_goal", {
enum: [
"weight_loss",
"muscle_gain",
"endurance",
"flexibility",
"general_fitness",
],
}),
activityLevel: text("activity_level", {
enum: [
"sedentary",
"lightly_active",
"moderately_active",
"very_active",
"extremely_active",
],
}),
medicalConditions: text("medical_conditions"),
allergies: text("allergies"),
injuries: text("injuries"),
createdAt: integer("created_at", { mode: "timestamp" })
.notNull()
.$defaultFn(() => new Date()),
updatedAt: integer("updated_at", { mode: "timestamp" })
.notNull()
.$defaultFn(() => new Date()),
});
export type User = typeof users.$inferSelect;
export type NewUser = typeof users.$inferInsert;
export type Client = typeof clients.$inferSelect;
@@ -114,3 +155,5 @@ export type Attendance = typeof attendance.$inferSelect;
export type NewAttendance = typeof attendance.$inferInsert;
export type Notification = typeof notifications.$inferSelect;
export type NewNotification = typeof notifications.$inferInsert;
export type FitnessProfile = typeof fitnessProfiles.$inferSelect;
export type NewFitnessProfile = typeof fitnessProfiles.$inferInsert;