-- v4-P2-3: Add gradeId column to learning_diagnostic_reports for grade-level diagnostic reports
ALTER TABLE `learning_diagnostic_reports` ADD COLUMN `grade_id` varchar(128);--> statement-breakpoint
ALTER TABLE `learning_diagnostic_reports` ADD CONSTRAINT `learning_diagnostic_reports_grade_id_grades_id_fk` FOREIGN KEY (`grade_id`) REFERENCES `grades`(`id`) ON DELETE set null ON UPDATE no action;--> statement-breakpoint
CREATE INDEX `diagnostic_grade_idx` ON `learning_diagnostic_reports` (`grade_id`);
