Skip to main content

mebook_sections

Overview

The mebook_sections table defines the top-level sections of the MeBook system. MeBook is a structured self-reflection tool where users answer questions that optionally map to app preferences. Sections group related questions (e.g., "Communication Style", "Social Energy"). This table is seeded by the migration and not user-editable.

Relevant Invariants

  • Invariant #19: "Complexity Must Be Earned" -- MeBook sections unlock progressively

Schema

-- From 20260130_mebook_system.sql
CREATE TABLE mebook_sections (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
key TEXT UNIQUE NOT NULL,
title TEXT NOT NULL,
description TEXT,
icon TEXT,
sort_order INTEGER DEFAULT 0,
is_active BOOLEAN DEFAULT TRUE,
created_at TIMESTAMPTZ DEFAULT NOW()
);

Columns

ColumnTypeNullableDefaultDescription
iduuidNogen_random_uuid()Primary key
keytextNo--Unique section key
titletextNo--Section display title
descriptiontextYes--Section description
icontextYes--Section icon identifier
sort_orderintegerNo0Display order
is_activebooleanNoTRUEWhether section is available
created_attimestamptzNoNOW()Seed timestamp

RLS Policies

-- SELECT: All authenticated users can read sections
CREATE POLICY "Sections are readable by all"
ON mebook_sections FOR SELECT
USING (true);

Last updated: 2026-02-07