Demo Organizations & Seed Data
Demo Organizations & Seed Data
Last verified against code: 2026-09-20
Overview
Demo is a property of an organization, not a user role. A demo tenant is
an ordinary organization with organizations.is_demo = true and pre-seeded
sample data; the people inside it hold ordinary organization roles
(org_admin, supervisor, caseworker, viewer).
The former demo base role was retired by the role model refactor
(20260920120001_role_model_01_remap.sql): existing demo users became
org_admin of their demo organization, which was flagged is_demo.
Pre-seeded Data
- Resources (12), Households (8), Document types (14), Inventory (categories and items), Programs (5). See migration
DATABASE_MIGRATION_DEMO_ROLE.sqlfor the seeder functions.
Creating a Demo Organization
- Create the organization and seed it:
SELECT seed_complete_demo_data('Demo — Acme', NULL);— returns the org id. UPDATE organizations SET is_demo = true WHERE id = '<org id>';- Create users in that organization through Admin → Add User with the role you want to demonstrate (usually Organization Admin).
assign_demo_role(profile_id, org_name) still exists for backwards
compatibility but no longer changes profiles.role; treat it as
"seed an org for this user" and set is_demo afterwards.
Related
- Access Control
- Role model refactor
- Migration:
database/migrations/DATABASE_MIGRATION_DEMO_ROLE.sql
Use links in each imported doc to open its source.