c750ad0423
- Created a new SQL migration to define the organization_exercise_settings table with relevant fields and an index. - Implemented handlers for loading and updating organization exercise settings in Rust, including default values and upsert functionality. - Developed a React component for managing exercise feature settings, allowing toggling of features and saving updates to the backend.
16 lines
751 B
SQL
16 lines
751 B
SQL
CREATE TABLE IF NOT EXISTS organization_exercise_settings (
|
|
organization_id UUID PRIMARY KEY REFERENCES organizations(id) ON DELETE CASCADE,
|
|
audio_response_enabled BOOLEAN NOT NULL DEFAULT TRUE,
|
|
hotspot_enabled BOOLEAN NOT NULL DEFAULT TRUE,
|
|
memory_match_enabled BOOLEAN NOT NULL DEFAULT TRUE,
|
|
peer_review_enabled BOOLEAN NOT NULL DEFAULT TRUE,
|
|
role_playing_enabled BOOLEAN NOT NULL DEFAULT TRUE,
|
|
mermaid_enabled BOOLEAN NOT NULL DEFAULT FALSE,
|
|
code_lab_enabled BOOLEAN NOT NULL DEFAULT TRUE,
|
|
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
|
|
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
|
|
);
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_org_exercise_settings_updated_at
|
|
ON organization_exercise_settings (updated_at DESC);
|