Charley requires PostgreSQL 16. The schema is fully idempotent — you can apply it multiple times safely.
Applying the Schema
psql $DATABASE_RW_URL -f db/schema.sql
The schema creates the following tables:
| Table | Description |
|---|
orgs | Organizations / workspaces |
org_members | Members with roles |
licenses | Billing plan and subscription state |
devices | Enrolled endpoint devices |
telemetry_rollups | Hourly and daily analytics aggregates |
device_enrollment_codes | One-time enrollment codes |
org_invites | Pending email invitations |
notifications | In-app notification feed |
org_sso_config | SAML/OIDC SSO configuration |
org_alert_endpoints | Webhook alert destinations |
org_slack_integrations | Slack workspace connections |
Seed Data (Development)
To populate the database with a test organization and sample telemetry:
psql $DATABASE_RW_URL -f db/seed.sql
The seed creates:
- 1 test organization
- 1 ORG_ADMIN member (matched by email — update
seed.sql to match your Auth0 user’s email)
- 2 test devices
- 30 days of daily telemetry rollups
- 48 hours of hourly telemetry rollups
Only apply seed.sql to development databases. It inserts fixed IDs that will conflict if applied to a database that already has data.
Running Locally with Docker
The repository includes a docker-compose.yml for local development:
# Start Postgres only
./dev.sh --local-db
# Start Postgres + pgAdmin GUI
./dev.sh --local-db --tools
pgAdmin is available at http://localhost:5050 when started with --tools.
Connection Details (local Docker)
| Field | Value |
|---|
| Host | localhost |
| Port | 5432 |
| Database | charley |
| User | charley |
| Password | secret |
Migrations
There is no migration framework in the current codebase — the schema is maintained as a single idempotent schema.sql. For production schema changes, apply DDL statements manually or through your database management tooling.