Code maintainability fixes

This commit is contained in:
AG
2025-12-06 11:32:40 +02:00
parent a13ef9f479
commit 4106f3b783
23 changed files with 1775 additions and 796 deletions

View File

@@ -7,7 +7,6 @@ generator client {
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
model User {
@@ -60,6 +59,7 @@ model Exercise {
isUnilateral Boolean @default(false)
sets WorkoutSet[]
planExercises PlanExercise[]
}
model WorkoutSession {
@@ -102,8 +102,19 @@ model WorkoutPlan {
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
name String
description String?
exercises String // JSON string of exercise IDs
exercises String? // JSON string of exercise IDs (Deprecated, to be removed)
planExercises PlanExercise[]
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
model PlanExercise {
id String @id @default(uuid())
planId String
plan WorkoutPlan @relation(fields: [planId], references: [id], onDelete: Cascade)
exerciseId String
exercise Exercise @relation(fields: [exerciseId], references: [id])
order Int
isWeighted Boolean @default(false)
}