Database schemas for internal tools
SQL schemas for the internal tools small teams build: tables, keys, constraints and indexes you can run as they are. Each one is written from a blueprint on this site, so it comes with the business rules, screens, phased build prompts and acceptance checks the tables are for. Every schema was run unmodified on two engines, SQLite and PostgreSQL, and loads the blueprint's own seed data, so the example queries return real rows.
- Approval workflow database schema
A 6-table SQL schema for a spend approval workflow: people, routing rules, requests, steps, audit events. Runs on SQLite and PostgreSQL and loads sample data.
Open - Async standup app database schema
An async standup schema in 12 tables: check-ins per time zone, answers, blockers and an outbox. Runs on SQLite and PostgreSQL and loads sample data.
Open - Bug tracking system database schema
A bug tracking system schema in 10 tables: bugs, a lifecycle, duplicates, fix targets and an activity log. Runs on SQLite and PostgreSQL and loads sample data.
Open - Resource planning system database schema
Resource planning database schema: 9 tables for people, working hours, time off, projects, phase budgets and weekly bookings. Runs on SQLite and PostgreSQL.
Open - Client onboarding system database schema
A client onboarding schema in 10 tables: templates, staged projects, tasks, handoffs and client links. Runs on SQLite and PostgreSQL and loads sample data.
Open - Editorial calendar database schema
A content calendar schema in 7 tables: pieces with an approval workflow, channels, campaigns and a log. Runs on SQLite and PostgreSQL and loads sample data.
Open - Contract management system database schema
A 9-table contract management schema: contracts, counterparties, terms, reminders, documents and decisions. Runs on SQLite and PostgreSQL and loads sample data.
Open - Customer feedback management system database schema
An 11-table customer feedback schema with themes, account votes, MRR ranking, a roadmap and follow-ups. Runs on SQLite and PostgreSQL and loads sample data.
Open - Client document collection system database schema
A 13-table client document request schema: checklists, uploads, reviews, access codes and reminders. Runs on SQLite and PostgreSQL and loads sample data.
Open - Employee onboarding system database schema
An employee onboarding schema in 10 tables: templates, role-based tasks, private check-ins and an outbox. Runs on SQLite and PostgreSQL and loads sample data.
Open - IT asset management database schema
A 9-table IT asset tracking schema: tagged items, check-out history, warranty dates, asset checks and an event log. Runs on SQLite and PostgreSQL.
Open - Expense management system database schema
An 8-table expense report schema: reports with approval and reimbursement, expenses in cents, mileage, categories with limits. Runs on SQLite and PostgreSQL.
Open - Feature request tracking system database schema
Feature request database schema: 15 tables for ideas, votes, merges, statuses, a changelog and revenue by account. Runs on SQLite and PostgreSQL.
Open - Help desk ticketing system database schema
A help desk ticketing schema in 9 tables: tickets, threaded messages, events and an email outbox. Runs on SQLite and PostgreSQL and loads sample data.
Open - Applicant tracking system database schema
Applicant tracking system schema in 13 tables: roles, candidates, applications, interviews, scorecards. Runs on SQLite and PostgreSQL with sample data.
Open - Inspection checklist app database schema
An inspection checklist schema in 15 tables: versioned templates, schedules, scored answers and actions. Runs on SQLite and PostgreSQL and loads sample data.
Open - Knowledge base database schema
A 15-table knowledge base schema with verified cards, owners, review dates, flags and versions. Runs on SQLite and PostgreSQL and loads sample data.
Open - Inventory management system database schema
Inventory database schema: 11 tables for items, locations, stock movements, purchase orders and counts. Runs on SQLite and PostgreSQL and loads sample data.
Open - Accounts receivable collections database schema
A 13-table SQL schema for overdue invoice reminders: customers, invoices, payments, reminder steps, sent log. Runs on SQLite and PostgreSQL with sample data.
Open - URL shortener database schema
A 10-table URL shortener schema with UTM campaigns, QR scans, click counting and change history. Runs on SQLite and PostgreSQL and loads sample data.
Open - Maintenance work order system database schema
A 17-table maintenance request and work order schema with checklists and preventive schedules. Runs on SQLite and PostgreSQL and loads sample data.
Open - NPS survey system database schema
An 11-table NPS survey schema: contacts, sends, responses, follow-ups, notes and tags. Runs on SQLite and PostgreSQL and loads sample data.
Open - OKR software database schema
OKR database schema: 10 tables for cycles, objectives, key results, check-ins and target changes. Runs on SQLite and PostgreSQL and loads sample data.
Open - Performance review system database schema
Performance review system schema in 11 tables: cycles, templates, reviews, answers, peer requests, calibration. Runs on SQLite and PostgreSQL with sample data.
Open - Project status tracking database schema
A 6-table SQL schema for weekly project status updates: people, projects, one update per week, activity log. Runs on SQLite and PostgreSQL with sample data.
Open - Sales quote management system database schema
A 13-table sales quote schema with a price list, discount approvals, client links and invoices. Runs on SQLite and PostgreSQL and loads sample data.
Open - SaaS management system database schema
A 6-table SaaS spend schema for subscriptions, seats, renewals, notice periods and reminders. Runs on SQLite and PostgreSQL and loads sample data.
Open - Sales commission database schema
A 7-table sales commission schema: tiered plans, quotas, split deals, monthly periods locked at approval and clawbacks. Runs on SQLite and PostgreSQL.
Open - Employee shift scheduling system database schema
Shift scheduling database schema: 13 tables for staff, positions, weeks, shifts, swaps and time off. Runs on SQLite and PostgreSQL and loads sample data.
Open - CRM database schema
A 6-table SQL schema for a small-team CRM: people, companies, contacts, deals, activities. Runs on SQLite and PostgreSQL and loads sample data.
Open - Status page database schema
A 16-table status page schema: components, incidents with updates, maintenance, status history for uptime and subscribers. Runs on SQLite and PostgreSQL.
Open - Customer testimonial management system database schema
Testimonial database schema: 7 tables for testimonials with recorded consent, invitations and history. Runs on SQLite and PostgreSQL with sample data.
Open - Leave management system database schema
A 12-table leave management schema with half-day bookings, approvals, carry-over and history. Runs on SQLite and PostgreSQL and loads sample data.
Open - Timesheet management system database schema
A 9-table timesheet schema: weekly timesheets with approval, entries in minutes, project rates, budgets and an outbox. Runs on SQLite and PostgreSQL.
Open - Employee training system database schema
Employee training system schema in 16 tables: subjects, steps, quizzes, assignments, reads, signatures, policy versions. Runs on SQLite and PostgreSQL.
Open - Visitor management system database schema
An 11-table visitor management schema: visits, invites, visit types, versioned documents and signatures. Runs on SQLite and PostgreSQL and loads sample data.
Open
How these are made
Each schema starts as the data model section of a blueprint: every entity and field in the spec becomes a table and a column, enumerations become CHECK constraints with the spec's exact values, and rules the database cannot enforce in portable SQL are named in a comment on the table instead of being left out. The same file is then run, unchanged, on SQLite and on PostgreSQL, the blueprint's seed data is loaded with foreign keys enforced, and the example queries must return the same rows on both.
The design decisions that came back across these schemas, with excerpts from the SQL, are collected in how to design the database for an internal tool.
What that does not cover: MySQL and other engines, other versions, performance under real load, and migrations from an existing database. Each schema page says so, next to the versions it was run on.