mebook_user_progress
Overview
The mebook_user_progress table (referenced in CLAUDE.md as part of the MeBook system) tracks how far each user has progressed through the MeBook sections. This table is listed in the CLAUDE.md database overview. The MeBook system includes creation progress tracking for section-by-section completion.
Note: The migration file (20260130_mebook_system.sql) creates a mebook_creation_progress table which may serve this same purpose. The CLAUDE.md references mebook_user_progress as the table name.
Schema
-- From 20260130_mebook_system.sql (as mebook_creation_progress)
CREATE TABLE mebook_user_progress (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
user_id UUID NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE,
section_id UUID NOT NULL REFERENCES mebook_sections(id) ON DELETE CASCADE,
status TEXT DEFAULT 'not_started' CHECK (status IN ('not_started', 'in_progress', 'completed', 'skipped')),
started_at TIMESTAMPTZ,
completed_at TIMESTAMPTZ,
created_at TIMESTAMPTZ DEFAULT NOW(),
updated_at TIMESTAMPTZ DEFAULT NOW(),
UNIQUE(user_id, section_id)
);
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | No | gen_random_uuid() | Primary key |
user_id | uuid | No | -- | User whose progress this tracks |
section_id | uuid | No | -- | MeBook section |
status | text | No | 'not_started' | Progress: not_started, in_progress, completed, skipped |
started_at | timestamptz | Yes | -- | When user started this section |
completed_at | timestamptz | Yes | -- | When user completed this section |
created_at | timestamptz | No | NOW() | Row creation timestamp |
updated_at | timestamptz | No | NOW() | Last update timestamp |
RLS Policies
-- SELECT: Users can view their own progress
CREATE POLICY "Users can view own progress"
ON mebook_user_progress FOR SELECT
USING (auth.uid() = user_id);
-- INSERT/UPDATE: Users can manage their own progress
CREATE POLICY "Users can manage own progress"
ON mebook_user_progress FOR ALL
USING (auth.uid() = user_id);
Related
- mebook_sections -- Section being tracked
- mebook_responses -- Individual answers within section
- profiles -- User whose progress this tracks
Last updated: 2026-02-07