Skip to content

EPIC-01.1: Lesson Status & Authorship Schema #8

@Peleke

Description

@Peleke

Epic: EPIC-01 Database Foundation
Story Points: 5
Priority: P0

User Story

As a content author, I want lesson draft/publish status tracking, so that I can work on lessons privately before publishing.

Acceptance Criteria

  • lessons table has status column (draft|published|archived)
  • lessons table has author_id column (FK to auth.users)
  • lessons.overview is nullable (draft-first approach)
  • Indexes on status and author_id for performance
  • updated_at trigger updates timestamp on changes

Technical Tasks

File: supabase/migrations/YYYYMMDD_lesson_authoring_foundation.sql

  • Add status column with CHECK constraint
  • Add author_id column with FK
  • Make overview nullable
  • Create indexes (status, author_id)
  • Add updated_at trigger

Tests

  • Draft lesson can be created with minimal data
  • Status transitions work (draft → published → archived)
  • Author_id correctly references auth.users

Related Docs

Metadata

Metadata

Assignees

No one assigned

    Labels

    epic:01-databaseEPIC-01: Database Foundationpriority:p0Critical priority - MVP blockerstype:backendBackend/Database work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions