feat: Prepare DB architecture for AI multimedia ecosystem
- Add ai_podcast_url and ai_video_url to lessons for NotebookLM integration - Add markdown_content to lessons to store extracted PDF curriculum directly in DB - Create lesson_resources table for managing Worksheets, Summaries, and Books PDFs
This commit is contained in:
@@ -218,11 +218,21 @@ CREATE TABLE IF NOT EXISTS `lessons` (
|
|||||||
`course_id` BIGINT UNSIGNED NOT NULL,
|
`course_id` BIGINT UNSIGNED NOT NULL,
|
||||||
`title` VARCHAR(255) NOT NULL,
|
`title` VARCHAR(255) NOT NULL,
|
||||||
`sequence_order` INT UNSIGNED NOT NULL DEFAULT 1,
|
`sequence_order` INT UNSIGNED NOT NULL DEFAULT 1,
|
||||||
|
|
||||||
|
-- المعلم الحقيقي (Teacher Video)
|
||||||
`video_uuid` VARCHAR(64) DEFAULT NULL,
|
`video_uuid` VARCHAR(64) DEFAULT NULL,
|
||||||
`hls_url` VARCHAR(500) DEFAULT NULL,
|
`hls_url` VARCHAR(500) DEFAULT NULL,
|
||||||
`timeline_chapters_json` JSON DEFAULT NULL,
|
`timeline_chapters_json` JSON DEFAULT NULL,
|
||||||
`bunny_video_id` VARCHAR(100) DEFAULT NULL,
|
`bunny_video_id` VARCHAR(100) DEFAULT NULL,
|
||||||
`duration_seconds` INT UNSIGNED NOT NULL DEFAULT 0,
|
`duration_seconds` INT UNSIGNED NOT NULL DEFAULT 0,
|
||||||
|
|
||||||
|
-- الذكاء الاصطناعي (NotebookLM / AI Audio-Video Explanations)
|
||||||
|
`ai_podcast_url` VARCHAR(500) DEFAULT NULL COMMENT 'رابط الشرح الصوتي المولد بالذكاء الاصطناعي (NotebookLM style)',
|
||||||
|
`ai_video_url` VARCHAR(500) DEFAULT NULL COMMENT 'رابط فيديو الشرح الآلي بالذكاء الاصطناعي',
|
||||||
|
|
||||||
|
-- المحتوى النصي المفرغ من الـ PDF
|
||||||
|
`markdown_content` LONGTEXT DEFAULT NULL COMMENT 'محتوى الدرس النصي بصيغة Markdown و LaTeX',
|
||||||
|
|
||||||
`is_free_preview` TINYINT(1) NOT NULL DEFAULT 0,
|
`is_free_preview` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
`created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
`created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
`updated_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
`updated_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||||
@@ -232,6 +242,22 @@ CREATE TABLE IF NOT EXISTS `lessons` (
|
|||||||
CONSTRAINT `fk_lessons_course` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
CONSTRAINT `fk_lessons_course` FOREIGN KEY (`course_id`) REFERENCES `courses` (`id`) ON DELETE CASCADE
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
|
-- ------------------------------------------------------------------------------
|
||||||
|
-- 10.5. Table: lesson_resources (المصادر المرفقة للدرس: كتب، ملخصات، أوراق عمل PDF)
|
||||||
|
-- ------------------------------------------------------------------------------
|
||||||
|
CREATE TABLE IF NOT EXISTS `lesson_resources` (
|
||||||
|
`id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
`lesson_id` BIGINT UNSIGNED NOT NULL,
|
||||||
|
`title` VARCHAR(255) NOT NULL,
|
||||||
|
`resource_type` ENUM('book_pdf', 'summary_pdf', 'worksheet_pdf', 'external_link') NOT NULL DEFAULT 'summary_pdf',
|
||||||
|
`file_url` VARCHAR(500) NOT NULL,
|
||||||
|
`is_ai_generated` TINYINT(1) NOT NULL DEFAULT 0,
|
||||||
|
`created_at` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
PRIMARY KEY (`id`),
|
||||||
|
KEY `idx_resources_lesson` (`lesson_id`),
|
||||||
|
CONSTRAINT `fk_resources_lesson` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE CASCADE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
|
|
||||||
-- ------------------------------------------------------------------------------
|
-- ------------------------------------------------------------------------------
|
||||||
-- 11. Table: video_quality_assessments (تقييم جودة المحتوى التعليمي والتوافق بالذكاء الاصطناعي)
|
-- 11. Table: video_quality_assessments (تقييم جودة المحتوى التعليمي والتوافق بالذكاء الاصطناعي)
|
||||||
-- ------------------------------------------------------------------------------
|
-- ------------------------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user