Skip to main content

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

ColumnTypeNullableDefaultDescription
iduuidNogen_random_uuid()Primary key
question_iduuidNo--Parent question
labeltextNo--Display label for this option
valuetextNo--Option value
descriptiontextYes--Option description
maps_to_valuetextYes--Preference value mapped to this choice
sort_orderintegerNo0Display order
created_attimestamptzNoNOW()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);

Last updated: 2026-02-07