Skip to main content

charter_toggle_definitions

Overview

The charter_toggle_definitions table contains the system-defined set of community norm toggles available for circle charters. Each toggle represents a behavioral expectation (e.g., "Be respectful", "Stay on topic"). These are seeded by the migration and are not user-editable.

Schema

-- From 20260131_circle_charters_schema.sql
CREATE TABLE charter_toggle_definitions (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
key TEXT UNIQUE NOT NULL,
label TEXT NOT NULL,
description TEXT,
category TEXT DEFAULT 'general',
default_enabled BOOLEAN DEFAULT TRUE,
sort_order INTEGER DEFAULT 0,
created_at TIMESTAMPTZ DEFAULT NOW()
);

Columns

ColumnTypeNullableDefaultDescription
iduuidNogen_random_uuid()Primary key
keytextNo--Unique toggle key (e.g., 'respect')
labeltextNo--Display label for the toggle
descriptiontextYes--Explanation of what this norm means
categorytextNo'general'Toggle category grouping
default_enabledbooleanNoTRUEWhether enabled by default in new charters
sort_orderintegerNo0Display order
created_attimestamptzNoNOW()Seed timestamp

RLS Policies

-- SELECT: All authenticated users can read toggle definitions
CREATE POLICY "Anyone can read charter toggles"
ON charter_toggle_definitions FOR SELECT
USING (true);

Last updated: 2026-02-07