p-project-new
Tables (21)
AIInferenceLog
- inferenceLogId — BIGINT
- userId — BIGINT — NOT NULL
- modelKey — VARCHAR(100) — NOT NULL
- inputSnapshot — JSON
- outputSnapshot — JSON
- knowledgeReferences — JSON — NOT NULL
- INDEX — idx_user
- INDEX — idx_model
Address
- addressId — BIGINT
- userId — BIGINT — NOT NULL
- city — VARCHAR(50)
- district — VARCHAR(50)
- street — VARCHAR(100)
- zipcode — VARCHAR(10)
- streetCode — VARCHAR(20)
- detailAddress — VARCHAR(200)
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_user
AuditLog
- auditLogId — BIGINT
- userId — BIGINT — NOT NULL
- entity — VARCHAR(100)
- details — JSON
- ipAddress — VARCHAR(45)
- traceId — VARCHAR(100)
- createdAt — DATETIME — NOT NULL
- INDEX — idx_user_action
- INDEX — idx_created
Consent
- agreeId — BIGINT
- userId — BIGINT — NOT NULL
- termsId — BIGINT — NOT NULL
- isAgreed — BOOLEAN — NOT NULL
- agreedAt — DATETIME
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_user
DailySummary
- summaryId — BIGINT
- userId — BIGINT — NOT NULL
- date — DATE — NOT NULL
- allExercisesCompleted — BOOLEAN
- exerciseCompletionRate — INT — 최근 7일 트렌드
- allMedicationsTaken — BOOLEAN
- medicationCompletionRate — INT — 최근 14일 트렌드
- avgPainScore — INT — 점수 영향 요인
- totalDurationSec — INT — 투여 경로
- dailyMetrics — JSON
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_user_date — 스케줄 규칙
- =일일 — 요약
Exercise
- exerciseId — BIGINT
- title — VARCHAR(255) — NOT NULL
- description — TEXT
- bodyPart — VARCHAR(100)
- difficulty — ENUM('BEGINNER', 'INTERMEDIATE', 'ADVANCED')
- equipment — VARCHAR(255)
- contraindications — JSON — 난이도 조정 규칙
- progressionRules — JSON — 근거 수준
- evidenceLevel — ENUM('A', 'B', 'C', 'D') — 추천 근거, 모델 버전 등
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_bodypart
- INDEX — idx_difficulty
ExerciseEvidence
- evidenceId — BIGINT
- exerciseId — BIGINT — NOT NULL
- knowledgeId — BIGINT — NOT NULL
- recommendationBasis — TEXT
- clinicalGuidelines — JSON
- createdAt — DATETIME — NOT NULL
- INDEX — idx_exercise
- INDEX — idx_knowledge
ExerciseImage
- exerciseImageId — BIGINT
- exerciseId — BIGINT — NOT NULL
- title — VARCHAR(255)
- imageUrl — VARCHAR(500) — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_exercise
ExerciseLog
- exerciseLogId — BIGINT
- userId — BIGINT — NOT NULL
- planItemId — BIGINT — NOT NULL
- loggedAt — DATETIME — NOT NULL
- painBefore — INT — 소요 시간 (초)
- painAfter — INT — 운동 완료율 (%)
- rpe — INT — 복약 완료율 (%)
- completionRate — INT — 평균 통증 (1-10)
- durationSec — INT — 총 운동 시간 (초)
- status — ENUM('COMPLETED', 'PARTIAL', 'SKIPPED')
- notes — TEXT
- createdAt — DATETIME — NOT NULL
- INDEX — idx_user_date
- INDEX — idx_planitem — 일일 회복 점수 (0-10
ExerciseMedia
- exerciseMediaId — BIGINT
- exerciseId — BIGINT — NOT NULL
- url — VARCHAR(500) — NOT NULL
- mediaType — ENUM('VIDEO', 'GIF') — NOT NULL
- language — VARCHAR(10)
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_exercise
MediSchedule
- scheduleId — BIGINT
- medicationId — BIGINT — NOT NULL
- timeOfDay — ENUM('MORNING', 'LUNCH', 'DINNER', 'BEDTIME') — NOT NULL
- notify — BOOLEAN
- rrule — VARCHAR(500)
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_medication
MedicalKnowledge
- knowledgeId — BIGINT
- title — VARCHAR(255) — NOT NULL
- content — TEXT — NOT NULL
- category — ENUM('GUIDELINE', 'PROTOCOL', 'RESEARCH', 'CONTRAINDICATION') — NOT NULL
- sourceReference — VARCHAR(500)
- evidenceLevel — ENUM('A', 'B', 'C', 'D')
- metadata — JSON
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_category
- INDEX — idx_evidence_level
Medication
- medicationId — BIGINT
- userId — BIGINT — NOT NULL
- name — VARCHAR(255) — NOT NULL
- dose — VARCHAR(100)
- route — VARCHAR(50) — 응답 시간 (ms)
- instructions — TEXT
- description — TEXT
- status — ENUM('ACTIVE', 'COMPLETED', 'STOPPED')
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_user — 행위자 (NULL=시스
MedicationLog
- medicationLogId — BIGINT
- userId — BIGINT — NOT NULL
- medicationId — BIGINT — NOT NULL
- takenAt — DATETIME — NOT NULL
- timeOfDay — ENUM('MORNING', 'LUNCH', 'DINNER', 'BEDTIME')
- taken — BOOLEAN
- notes — TEXT
- createdAt — DATETIME — NOT NULL
- INDEX — idx_user_date
- INDEX — idx_medication
PlanItem
- planItemId — BIGINT
- rehabPlanId — BIGINT — NOT NULL
- exerciseId — BIGINT — NOT NULL
- orderIndex — INT
- phase — ENUM('ACUTE', 'SUBACUTE', 'CHRONIC', 'MAINTENANCE')
- dose — JSON — 운동 후 통증 (1-10)
- status — ENUM('ACTIVE', 'COMPLETED', 'SKIPPED')
- recommendationReason — JSON — 체감 강도 (1-10)
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_rehabplan
- INDEX — idx_exercise — 완료율 (0-100
RecoveryScore
- recoveryScoreId — BIGINT
- userId — BIGINT — NOT NULL
- date — DATE — NOT NULL
- dailyScore — DECIMAL(5, 2) — {start_date, end_date}
- scoreTrend7d — JSON — 주간 하이라이트
- scoreTrend14d — JSON — 회복 예측
- scoreFactors — JSON — recommend/predict/chat
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_user_date — 참조한 의학 지식 ID 목록
- =회복 — 점수
RehabPlan
- rehabPlanId — BIGINT
- userId — BIGINT — NOT NULL
- title — VARCHAR(255)
- status — ENUM('ACTIVE', 'COMPLETED', 'PAUSED')
- startDate — DATETIME
- endDate — DATETIME
- meta — JSON — {sets, reps, hold_sec, rest_sec}
- generatedBy — VARCHAR(50) — AI 추천 이유
- modelVersion — VARCHAR(50)
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_user
- INDEX — idx_status — 운동 전 통증 (1-1
Reminder
- reminderId — BIGINT
- userId — BIGINT — NOT NULL
- type — ENUM('EXERCISE', 'MEDICATION', 'GENERIC') — NOT NULL
- channel — ENUM('PUSH', 'WEBPUSH', 'EMAIL', 'SMS') — NOT NULL
- rule — JSON — NOT NULL
- nextFireAt — DATETIME
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_user
- INDEX — idx_nextfire
ReportSnapshot
- reportSnapshotId — BIGINT
- userId — BIGINT — NOT NULL
- period — ENUM('WEEKLY', 'MONTHLY', 'QUARTERLY') — NOT NULL
- coveredRange — JSON — NOT NULL
- weeklyHighlight — JSON
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_user
- INDEX — idx_period
Terms
- termsId — BIGINT
- title — VARCHAR(255) — NOT NULL
- version — VARCHAR(20) — NOT NULL
- isRequired — BOOLEAN — NOT NULL
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_version
User
- userId — BIGINT
- username — VARCHAR(50) — NOT NULL
- nickname — VARCHAR(50)
- email — VARCHAR(100) — NOT NULL
- phoneNumber — VARCHAR(20)
- gender — ENUM('MALE', 'FEMALE', 'OTHER')
- profileImageUrl — VARCHAR(500)
- role — ENUM('USER', 'ADMIN') — NOT NULL
- currentStreak — INT — 현재 연속 일수
- maxStreak — INT — 최대 연속 기록
- lastActivityDate — DATE — 마지막 활동 날짜
- createdAt — DATETIME — NOT NULL
- updatedAt — DATETIME — NOT NULL
- INDEX — idx_email
- INDEX — idx_username