removed course management data seed

This commit is contained in:
Yared Yemane 2026-04-09 01:50:05 -07:00
parent 7918e62ca9
commit 7ecfdd9cc8
2 changed files with 7 additions and 104 deletions

View File

@ -315,112 +315,11 @@ VALUES
ON CONFLICT (set_id, question_id) DO NOTHING; ON CONFLICT (set_id, question_id) DO NOTHING;
-- ====================================================== -- ======================================================
-- Course Management Seed Data -- Course Management seed data removed intentionally.
-- Course/category/sub-course/video/practice/question-set fixtures
-- are no longer seeded from this baseline script.
-- ====================================================== -- ======================================================
-- Course Categories
INSERT INTO course_categories (name, is_active, created_at) VALUES
('Programming', TRUE, CURRENT_TIMESTAMP),
('Data Science', TRUE, CURRENT_TIMESTAMP),
('Web Development', TRUE, CURRENT_TIMESTAMP);
-- Courses
INSERT INTO courses (category_id, title, description, thumbnail, is_active) VALUES
(1, 'Python Programming Fundamentals', 'Learn Python from basics to advanced concepts', 'https://example.com/thumbnails/python.jpg', TRUE),
(1, 'JavaScript for Beginners', 'Master JavaScript programming language', 'https://example.com/thumbnails/javascript.jpg', TRUE),
(1, 'Advanced Java Development', 'Deep dive into Java enterprise development', 'https://example.com/thumbnails/java.jpg', TRUE),
(2, 'Data Analysis with Python', 'Learn data manipulation and analysis using pandas', 'https://example.com/thumbnails/data-analysis.jpg', TRUE),
(2, 'Machine Learning Basics', 'Introduction to machine learning algorithms', 'https://example.com/thumbnails/ml.jpg', TRUE),
(3, 'Full Stack Web Development', 'Complete guide to modern web development', 'https://example.com/thumbnails/fullstack.jpg', TRUE),
(3, 'React.js Masterclass', 'Build dynamic user interfaces with React', 'https://example.com/thumbnails/react.jpg', TRUE);
-- Sub-courses (replacing Programs/Levels hierarchy)
INSERT INTO sub_courses (course_id, title, description, thumbnail, display_order, level, sub_level, is_active) VALUES
-- Python Programming Fundamentals sub-courses
(1, 'Python Basics - Getting Started', 'Introduction to Python and basic syntax', NULL, 1, 'BEGINNER', 'A1', TRUE),
(1, 'Python Basics - Data Types', 'Understanding Python data types and variables', NULL, 2, 'BEGINNER', 'A2', TRUE),
(1, 'Python Intermediate - Functions', 'Writing and using functions in Python', NULL, 3, 'INTERMEDIATE', 'B1', TRUE),
(1, 'Python Intermediate - Collections', 'Working with Python collections', NULL, 4, 'INTERMEDIATE', 'B2', TRUE),
(1, 'Python Advanced - Best Practices', 'Advanced Python concepts and best practices', NULL, 5, 'ADVANCED', 'C1', TRUE),
-- JavaScript sub-courses
(2, 'JavaScript Fundamentals', 'Core JavaScript concepts and syntax', NULL, 1, 'BEGINNER', 'A1', TRUE),
(2, 'DOM Manipulation Basics', 'Working with the Document Object Model', NULL, 2, 'INTERMEDIATE', 'B1', TRUE),
-- Java sub-courses
(3, 'Java Core Concepts', 'Essential Java programming principles', NULL, 1, 'BEGINNER', 'A1', TRUE),
(3, 'Spring Framework Intro', 'Building enterprise applications with Spring', NULL, 2, 'ADVANCED', 'C1', TRUE),
-- Data Science sub-courses
(4, 'Data Analysis Fundamentals', 'Learn data manipulation with pandas', NULL, 1, 'BEGINNER', 'A1', TRUE),
(4, 'Advanced Data Analysis', 'Complex data transformations', NULL, 2, 'ADVANCED', 'C1', TRUE),
-- Machine Learning sub-courses
(5, 'ML Basics', 'Introduction to machine learning concepts', NULL, 1, 'BEGINNER', 'A1', TRUE),
(5, 'ML Algorithms', 'Understanding common ML algorithms', NULL, 2, 'INTERMEDIATE', 'B1', TRUE),
-- Full Stack Web Development sub-courses
(6, 'Frontend Fundamentals', 'HTML, CSS, and JavaScript basics', NULL, 1, 'BEGINNER', 'A1', TRUE),
(6, 'Backend Development', 'Server-side programming', NULL, 2, 'INTERMEDIATE', 'B1', TRUE),
-- React.js sub-courses
(7, 'React Basics', 'Core React concepts and JSX', NULL, 1, 'BEGINNER', 'A1', TRUE),
(7, 'React Advanced Patterns', 'Hooks, context, and performance', NULL, 2, 'ADVANCED', 'C1', TRUE);
-- Sub-course Videos
INSERT INTO sub_course_videos (
sub_course_id,
title,
description,
video_url,
duration,
resolution,
visibility,
display_order,
status
) VALUES
(1, 'Python Installation Guide', 'Installing Python', 'https://example.com/python-install.mp4', 900, '1080p', 'public', 1, 'PUBLISHED'),
(1, 'Your First Python Program', 'Writing and running your first Python script', 'https://example.com/python-hello.mp4', 1200, '1080p', 'public', 2, 'PUBLISHED'),
(2, 'Numbers and Math', 'Numeric types in Python', 'https://example.com/python-numbers.mp4', 1500, '720p', 'public', 1, 'PUBLISHED'),
(2, 'Strings in Python', 'Working with text data', 'https://example.com/python-strings.mp4', 1300, '1080p', 'public', 2, 'DRAFT'),
(3, 'Writing Functions', 'Creating reusable code with functions', 'https://example.com/python-functions.mp4', 1800, '1080p', 'public', 1, 'PUBLISHED');
-- Practice Question Sets (replacing practices table)
INSERT INTO question_sets (id, title, description, set_type, owner_type, owner_id, persona, status) VALUES
(2, 'Python Basics Assessment', 'Test Python basics', 'PRACTICE', 'SUB_COURSE', 1, 'beginner', 'PUBLISHED'),
(3, 'Data Types Practice', 'Practice Python data types', 'PRACTICE', 'SUB_COURSE', 2, 'beginner', 'PUBLISHED'),
(4, 'Functions Quiz', 'Assess function knowledge', 'PRACTICE', 'SUB_COURSE', 3, 'intermediate', 'DRAFT')
ON CONFLICT (id) DO NOTHING;
-- Practice Questions (using unified questions table)
INSERT INTO questions (id, question_text, question_type, tips, status)
VALUES
(17, 'What is the correct way to print "Hello World" in Python?', 'MCQ', 'Use print()', 'PUBLISHED'),
(18, 'Which is a valid Python variable name?', 'MCQ', 'Variables cannot start with numbers', 'PUBLISHED'),
(19, 'How do you convert "123" to an integer?', 'MCQ', 'Use int()', 'PUBLISHED'),
(20, 'How many times does range(3) loop run?', 'MCQ', 'Starts from zero', 'PUBLISHED')
ON CONFLICT (id) DO NOTHING;
-- Link practice questions to question sets
INSERT INTO question_set_items (set_id, question_id, display_order)
VALUES
(2, 17, 1), (2, 18, 2),
(3, 19, 1),
(4, 20, 1)
ON CONFLICT (set_id, question_id) DO NOTHING;
-- ======================================================
-- User Personas for Practice Sessions
-- Link existing users as personas to practice question sets
-- ======================================================
INSERT INTO question_set_personas (question_set_id, user_id, display_order)
VALUES
(2, 10, 1), (2, 11, 2),
(3, 12, 1),
(4, 10, 1), (4, 12, 2)
ON CONFLICT (question_set_id, user_id) DO NOTHING;
-- ====================================================== -- ======================================================
-- Team Members / Admin Panel Users (login via /api/v1/team/login) -- Team Members / Admin Panel Users (login via /api/v1/team/login)
-- Credentials: email + password@123 -- Credentials: email + password@123

View File

@ -66,6 +66,10 @@ seed_data:
sleep 1; \ sleep 1; \
done done
@for file in db/data/*.sql; do \ @for file in db/data/*.sql; do \
if [ "$$(basename $$file)" = "007_course_management_seed.sql" ]; then \
echo "Skipping $$file (course management seed disabled)"; \
continue; \
fi; \
echo "Seeding $$file..."; \ echo "Seeding $$file..."; \
cat $$file | docker exec -i yimaru-backend-postgres-1 psql -U root -d gh; \ cat $$file | docker exec -i yimaru-backend-postgres-1 psql -U root -d gh; \
done done