12d704a139
- Create migration scripts for lesson_collaborative_docs table in both cms-service and lms-service. - Implement CollaborativeDocEditor component for real-time editing of collaborative documents. - Add LessonCollaborativeDocPage for instructors to view and manage collaborative documents. - Include conflict resolution handling in the editor. - Enhance UI with status indicators and formatting options for the document editor. Co-authored-by: Copilot <copilot@github.com>
19 lines
731 B
SQL
19 lines
731 B
SQL
-- Fase 40: Documentos Colaborativos en Tiempo Real
|
|
CREATE TABLE IF NOT EXISTS lesson_collaborative_docs (
|
|
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
|
lesson_id UUID NOT NULL,
|
|
organization_id UUID NOT NULL,
|
|
course_id UUID NOT NULL,
|
|
content TEXT NOT NULL DEFAULT '',
|
|
revision BIGINT NOT NULL DEFAULT 0,
|
|
last_modified_by UUID,
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE UNIQUE INDEX IF NOT EXISTS idx_collab_docs_lesson
|
|
ON lesson_collaborative_docs (lesson_id, organization_id);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_collab_docs_org
|
|
ON lesson_collaborative_docs (organization_id);
|