mebook_question_options
Overview
The mebook_question_options table stores the available answer choices for multiple-choice MeBook questions. Each option can optionally map to a preference value that gets applied when selected.
Schema
-- From 20260130_mebook_system.sql
CREATE TABLE mebook_question_options (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
question_id UUID NOT NULL REFERENCES mebook_questions(id) ON DELETE CASCADE,
label TEXT NOT NULL,
value TEXT NOT NULL,
description TEXT,
maps_to_value TEXT,
sort_order INTEGER DEFAULT 0,
created_at TIMESTAMPTZ DEFAULT NOW()
);
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | No | gen_random_uuid() | Primary key |
question_id | uuid | No | -- | Parent question |
label | text | No | -- | Display label for this option |
value | text | No | -- | Option value |
description | text | Yes | -- | Option description |
maps_to_value | text | Yes | -- | Preference value mapped to this choice |
sort_order | integer | No | 0 | Display order |
created_at | timestamptz | No | NOW() | Seed timestamp |
RLS Policies
-- SELECT: All authenticated users can read options
CREATE POLICY "Options are readable by all"
ON mebook_question_options FOR SELECT
USING (true);
Related
- mebook_questions -- Parent question
- mebook_responses -- User selections
Last updated: 2026-02-07