Files
openccb/services/cms-service/migrations/20260406000010_course_templates.sql
Nurfog 92b4e4a3ac feat(cms/studio): agregar plantillas de curso reutilizables
- backend: CRUD básico de course templates y endpoint para crear curso desde plantilla
- migration: tabla course_templates con datos JSON del curso base
- frontend: nueva pantalla /course-templates para guardar y aplicar plantillas
- navegación: acceso desde menú Cursos
2026-04-06 15:34:57 -04:00

16 lines
665 B
SQL

-- Course templates for reusable course blueprints
CREATE TABLE IF NOT EXISTS course_templates (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
organization_id UUID NOT NULL REFERENCES organizations(id) ON DELETE CASCADE,
source_course_id UUID REFERENCES courses(id) ON DELETE SET NULL,
name TEXT NOT NULL,
description TEXT,
template_data JSONB NOT NULL,
created_by UUID REFERENCES users(id) ON DELETE SET NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_course_templates_org_created
ON course_templates (organization_id, created_at DESC);