feat(classes): migration 037 classes.required_form_id (optional form gate)

Nullable FK classes.required_form_id -> forms(id) ON DELETE SET NULL.
Mirrored in schema.sql, types, DATABASE_SCHEMA, DB_SCHEMA_MAP. Additive
nullable column on the already-policied classes table (no RLS change);
the signup gate is enforced in the app, mirroring the equipment cert-gate.
This commit is contained in:
Moheeb Zara
2026-05-16 21:33:53 -07:00
parent 268d78dd6d
commit 92c5737a25
5 changed files with 33 additions and 5 deletions
+1
View File
@@ -2115,6 +2115,7 @@ CREATE TABLE IF NOT EXISTS public.classes (
capacity integer CHECK (capacity IS NULL OR capacity > 0),
is_active boolean NOT NULL DEFAULT true,
grants_certification_id uuid REFERENCES public.certifications(id) ON DELETE SET NULL,
required_form_id uuid REFERENCES public.forms(id) ON DELETE SET NULL,
created_by uuid REFERENCES public.space_members(id) ON DELETE SET NULL,
created_at timestamptz NOT NULL DEFAULT now(),
updated_at timestamptz NOT NULL DEFAULT now()