Skip to main content

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

ColumnTypeNullableDefaultDescription
iduuidNogen_random_uuid()Primary key
user_iduuidNo--User whose progress this tracks
section_iduuidNo--MeBook section
statustextNo'not_started'Progress: not_started, in_progress, completed, skipped
started_attimestamptzYes--When user started this section
completed_attimestamptzYes--When user completed this section
created_attimestamptzNoNOW()Row creation timestamp
updated_attimestamptzNoNOW()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);

Last updated: 2026-02-07