Checkpoint: Tennis Training Hub v1.0 - 完整功能版本:用户名登录、AI训练计划生成、MediaPipe视频姿势识别、击球统计、挥拍速度分析、NTRP自动评分系统、训练进度追踪、视频库管理、AI矫正建议
这个提交包含在:
70
drizzle/0001_public_prowler.sql
普通文件
70
drizzle/0001_public_prowler.sql
普通文件
@@ -0,0 +1,70 @@
|
||||
CREATE TABLE `pose_analyses` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`videoId` int NOT NULL,
|
||||
`userId` int NOT NULL,
|
||||
`overallScore` float,
|
||||
`poseMetrics` json,
|
||||
`detectedIssues` json,
|
||||
`corrections` json,
|
||||
`exerciseType` varchar(64),
|
||||
`framesAnalyzed` int,
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
CONSTRAINT `pose_analyses_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `training_plans` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`userId` int NOT NULL,
|
||||
`title` varchar(256) NOT NULL,
|
||||
`skillLevel` enum('beginner','intermediate','advanced') NOT NULL,
|
||||
`durationDays` int NOT NULL DEFAULT 7,
|
||||
`exercises` json NOT NULL,
|
||||
`isActive` int NOT NULL DEFAULT 1,
|
||||
`adjustmentNotes` text,
|
||||
`version` int NOT NULL DEFAULT 1,
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `training_plans_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `training_records` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`userId` int NOT NULL,
|
||||
`planId` int,
|
||||
`exerciseName` varchar(128) NOT NULL,
|
||||
`durationMinutes` int,
|
||||
`completed` int NOT NULL DEFAULT 0,
|
||||
`notes` text,
|
||||
`poseScore` float,
|
||||
`trainingDate` timestamp NOT NULL DEFAULT (now()),
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
CONSTRAINT `training_records_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `training_videos` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`userId` int NOT NULL,
|
||||
`title` varchar(256) NOT NULL,
|
||||
`fileKey` varchar(512) NOT NULL,
|
||||
`url` text NOT NULL,
|
||||
`format` varchar(16) NOT NULL,
|
||||
`fileSize` int,
|
||||
`duration` float,
|
||||
`exerciseType` varchar(64),
|
||||
`analysisStatus` enum('pending','analyzing','completed','failed') DEFAULT 'pending',
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `training_videos_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `username_accounts` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`username` varchar(64) NOT NULL,
|
||||
`userId` int NOT NULL,
|
||||
`createdAt` timestamp NOT NULL DEFAULT (now()),
|
||||
CONSTRAINT `username_accounts_id` PRIMARY KEY(`id`),
|
||||
CONSTRAINT `username_accounts_username_unique` UNIQUE(`username`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `users` ADD `skillLevel` enum('beginner','intermediate','advanced') DEFAULT 'beginner';--> statement-breakpoint
|
||||
ALTER TABLE `users` ADD `trainingGoals` text;
|
||||
在新工单中引用
屏蔽一个用户