circle_charters
Overview
The circle_charters table stores the enabled/disabled state of each community norm toggle for each circle. When a circle is created, charter entries are auto-populated based on the defaults from charter_toggle_definitions. Circle admins can then toggle individual norms on or off.
Relevant Invariants
- Invariant #5: "Repair Over Punishment" -- Charters set expectations rather than enforcement rules
Schema
-- From 20260131_circle_charters_schema.sql
CREATE TABLE circle_charters (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
circle_id UUID NOT NULL REFERENCES circles(id) ON DELETE CASCADE,
toggle_key TEXT NOT NULL REFERENCES charter_toggle_definitions(key),
enabled BOOLEAN DEFAULT TRUE,
updated_at TIMESTAMPTZ DEFAULT NOW(),
UNIQUE(circle_id, toggle_key)
);
Columns
| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | uuid | No | gen_random_uuid() | Primary key |
circle_id | uuid | No | -- | Circle this charter belongs to |
toggle_key | text | No | -- | References charter_toggle_definitions(key) |
enabled | boolean | No | TRUE | Whether this norm is active |
updated_at | timestamptz | No | NOW() | Last toggle timestamp |
RLS Policies
-- SELECT: Circle members can view charter
CREATE POLICY "Circle members can view charter"
ON circle_charters FOR SELECT
USING (is_circle_member(auth.uid(), circle_id));
-- UPDATE: Circle admin can toggle norms
CREATE POLICY "Circle admin can update charter"
ON circle_charters FOR UPDATE
USING (is_circle_admin(auth.uid(), circle_id));
Related
- circles -- Parent circle
- charter_toggle_definitions -- Toggle definitions
Last updated: 2026-02-07