新增数学思维自学板块与考试板块(9模块154课+初一上5套真实试卷客观题)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
3473ecbf2b
commit
bc53e2b2a5
@@ -0,0 +1,84 @@
|
||||
CREATE TABLE `math_point` (
|
||||
`id` bigint AUTO_INCREMENT NOT NULL,
|
||||
`point_id` varchar(191) NOT NULL,
|
||||
`module` varchar(20) NOT NULL,
|
||||
`module_name` varchar(50) NOT NULL,
|
||||
`title` varchar(200) NOT NULL,
|
||||
`grade` varchar(30),
|
||||
`difficulty` int NOT NULL DEFAULT 1,
|
||||
`summary` text,
|
||||
`md` text NOT NULL,
|
||||
`seq` int NOT NULL,
|
||||
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `math_point_id` PRIMARY KEY(`id`),
|
||||
CONSTRAINT `uq_math_point_id` UNIQUE(`point_id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `math_progress` (
|
||||
`id` bigint AUTO_INCREMENT NOT NULL,
|
||||
`child_user_id` bigint NOT NULL,
|
||||
`point_id` varchar(191) NOT NULL,
|
||||
`score` int,
|
||||
`passed` boolean NOT NULL DEFAULT false,
|
||||
`completed_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `math_progress_id` PRIMARY KEY(`id`),
|
||||
CONSTRAINT `uq_math_child_point` UNIQUE(`child_user_id`,`point_id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `math_progress` ADD CONSTRAINT `math_progress_child_user_id_user_id_fk` FOREIGN KEY (`child_user_id`) REFERENCES `user`(`id`) ON DELETE cascade ON UPDATE no action;
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `math_weekly_test` (
|
||||
`id` bigint AUTO_INCREMENT NOT NULL,
|
||||
`child_user_id` bigint NOT NULL,
|
||||
`week_key` varchar(12) NOT NULL,
|
||||
`score` int,
|
||||
`correct` int,
|
||||
`total` int,
|
||||
`passed` boolean NOT NULL DEFAULT false,
|
||||
`questions` text,
|
||||
`taken_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `math_weekly_test_id` PRIMARY KEY(`id`),
|
||||
CONSTRAINT `uq_math_weekly_child_week` UNIQUE(`child_user_id`,`week_key`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `math_weekly_test` ADD CONSTRAINT `math_weekly_test_child_user_id_user_id_fk` FOREIGN KEY (`child_user_id`) REFERENCES `user`(`id`) ON DELETE cascade ON UPDATE no action;
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `exam_paper` (
|
||||
`id` bigint AUTO_INCREMENT NOT NULL,
|
||||
`paper_id` varchar(191) NOT NULL,
|
||||
`subject` varchar(20) NOT NULL DEFAULT 'math',
|
||||
`grade` varchar(20) NOT NULL,
|
||||
`semester` varchar(10) NOT NULL,
|
||||
`month` int NOT NULL,
|
||||
`exam_type` varchar(20) NOT NULL,
|
||||
`title` varchar(300) NOT NULL,
|
||||
`region` varchar(60),
|
||||
`year` int,
|
||||
`duration` int,
|
||||
`full_score` int,
|
||||
`source_url` varchar(500),
|
||||
`summary` text,
|
||||
`questions` text NOT NULL,
|
||||
`seq` int NOT NULL,
|
||||
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `exam_paper_id` PRIMARY KEY(`id`),
|
||||
CONSTRAINT `uq_exam_paper_id` UNIQUE(`paper_id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `idx_exam_paper_scope` ON `exam_paper` (`subject`,`grade`,`semester`,`month`);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE `exam_record` (
|
||||
`id` bigint AUTO_INCREMENT NOT NULL,
|
||||
`child_user_id` bigint NOT NULL,
|
||||
`paper_id` varchar(191) NOT NULL,
|
||||
`score` int,
|
||||
`correct` int,
|
||||
`total` int,
|
||||
`passed` boolean NOT NULL DEFAULT false,
|
||||
`answers` text,
|
||||
`taken_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `exam_record_id` PRIMARY KEY(`id`),
|
||||
CONSTRAINT `uq_exam_child_paper` UNIQUE(`child_user_id`,`paper_id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `exam_record` ADD CONSTRAINT `exam_record_child_user_id_user_id_fk` FOREIGN KEY (`child_user_id`) REFERENCES `user`(`id`) ON DELETE cascade ON UPDATE no action;
|
||||
@@ -22,6 +22,13 @@
|
||||
"when": 1785689264881,
|
||||
"tag": "0002_grammar-progress",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 3,
|
||||
"version": "5",
|
||||
"when": 1785772800000,
|
||||
"tag": "0003_math-and-exam",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user