Skip to content

Database

The platform uses Cloudflare D1 (edge SQLite) for all structured data. Schema is defined in db/schema.sql and seed data in db/seed.sql.

TablePurpose
usersAll authenticated users (auto-created on first login)
tool_permissionsPer-tool, per-access-level permission grants
squadsTeam groupings for data scoping
squad_membersUser-to-squad membership with manager flag
TablePurpose
onboarding_phases5 phases with name, description, sort order
onboarding_itemsChecklist items within phases
onboarding_progressPer-user completion state for each item
TablePurpose
scorecardsScorecard header (user, squad, week, notes)
scorecard_scoresIndividual score items (role, status, note)
scorecard_kpisMonthly KPIs (text, target, actual, status)
scorecard_metricsFinancial metrics (billable, utilisation, revenue, profit)
Terminal window
# Apply schema locally
pnpm db:migrate
# Apply seed data locally
pnpm db:seed
# Apply to remote (production)
wrangler d1 execute dotcollective-tools-db --remote --file=db/schema.sql
wrangler d1 execute dotcollective-tools-db --remote --file=db/seed.sql