Employee onboarding system database schema
Ten tables. tasks carries the design: each onboarding copies its base template and add-ons once, resolving every task's owner from a role (manager, IT, people team, buddy or new hire) and fixing its due date from an offset that skips weekends. onboardings copies the manager, title and template names at creation, so later changes to people or templates never rewrite an onboarding, and check-in notes sit on tasks with CHECKs that limit them to manager and people-team check-ins.
- 10 tables, 7 indexes
- Verified on SQLite 3.53.4 and PostgreSQL 19.0 (PGlite 0.6.1),
- 97 seed rows from the blueprint
- The blueprint's test build passed 20 of 20 acceptance checks
Employee onboarding entity-relationship diagram
Relationships
- people.manager_id references people.id: each people row points to at most one another people row, and one people row can have many people rows pointing to it.
- settings.it_owner_id references people.id: each settings row points to exactly one people row, and one people row can have many settings rows pointing to it.
- settings.people_owner_id references people.id: each settings row points to exactly one people row, and one people row can have many settings rows pointing to it.
- template_tasks.template_id references templates.id: each template_tasks row points to exactly one templates row, and one templates row can have many template_tasks rows pointing to it.
- onboardings.new_hire_id references people.id: each onboardings row points to exactly one people row, and one people row can have many onboardings rows pointing to it.
- onboardings.manager_id references people.id: each onboardings row points to exactly one people row, and one people row can have many onboardings rows pointing to it.
- onboardings.buddy_id references people.id: each onboardings row points to at most one people row, and one people row can have many onboardings rows pointing to it.
- onboardings.created_by references people.id: each onboardings row points to exactly one people row, and one people row can have many onboardings rows pointing to it.
- onboarding_templates.onboarding_id references onboardings.id: each onboarding_templates row points to exactly one onboardings row, and one onboardings row can have many onboarding_templates rows pointing to it.
- tasks.onboarding_id references onboardings.id: each tasks row points to exactly one onboardings row, and one onboardings row can have many tasks rows pointing to it.
- tasks.owner_id references people.id: each tasks row points to exactly one people row, and one people row can have many tasks rows pointing to it.
- tasks.done_by references people.id: each tasks row points to at most one people row, and one people row can have many tasks rows pointing to it.
- events.onboarding_id references onboardings.id: each events row points to exactly one onboardings row, and one onboardings row can have many events rows pointing to it.
- events.actor_id references people.id: each events row points to at most one people row, and one people row can have many events rows pointing to it.
- notifications.person_id references people.id: each notifications row points to exactly one people row, and one people row can have many notifications rows pointing to it.
- notifications.onboarding_id references onboardings.id: each notifications row points to at most one onboardings row, and one onboardings row can have many notifications rows pointing to it.
- digest_runs.person_id references people.id: each digest_runs row points to exactly one people row, and one people row can have many digest_runs rows pointing to it.
Employee onboarding tables
The schema has 10 tables. Every column below is read from the SQL file itself. Also described as: new hire onboarding database design, onboarding checklist database tables, HR onboarding app schema.
| Table | Implements | What a row is |
|---|---|---|
people | Person | A person at the company: team member, manager, buddy or new hire. |
settings | Settings | The single row with the company, time zone, IT owner, people owner and digest hour. |
templates | Template | A base template or an add-on. |
template_tasks | TemplateTask | One task in a template, with its owner role and day offset. |
onboardings | Onboarding | One new hire's onboarding with its manager, buddy, start date and status. |
onboarding_templates | child table of Onboarding | One template name copied onto an onboarding, base first. |
tasks | Task | One task on an onboarding, with its resolved owner, due date and status. |
events | Event | One append-only activity entry on an onboarding. |
notifications | Notification | One outgoing email in the outbox. |
digest_runs | DigestRun | One daily digest already queued for a person on a date. |
people
A person at the company: a team member, a manager, a buddy or a new hire. Deactivated, never deleted.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
name | TEXT | no | Check: LENGTH(name) BETWEEN 1 AND 100 | ||
email | TEXT | no | Unique | stored lowercaseCheck: email = LOWER(email) | |
title | TEXT | yes | optionalCheck: LENGTH(title) <= 100 | ||
manager_id | TEXT | yes | References people.id | ||
is_people_team | BOOLEAN | no | |||
active | BOOLEAN | no | |||
start_date | DATE | yes | set for new hires; they cannot sign in before it |
- Table check:
manager_id <> id - App rule (section 5): manager_id must be active and must not create a reporting loop; changing it never changes existing onboardings.
- App rule (R12): people who own open tasks on upcoming or in-progress onboardings, and the current IT and people owners, can't be deactivated.
settings
The single settings row. Comes after people because it names the IT and people owners.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | INTEGER | no | Primary key | one row onlyCheck: id = 1 | |
company_name | TEXT | no | |||
time_zone | TEXT | no | IANA name; "today" and every date are in this zone | ||
it_owner_id | TEXT | no | References people.id | receives it-role tasks; must be active (R12) | |
people_owner_id | TEXT | no | References people.id | receives people-role tasks; must be active (R12) | |
digest_hour | INTEGER | no | 8 | team timeCheck: digest_hour BETWEEN 0 AND 23 |
templates
A checklist template: one base template per onboarding, plus any add-ons. Deactivated, never deleted.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
name | TEXT | no | Check: LENGTH(name) BETWEEN 1 AND 80 | ||
kind | TEXT | no | Check: kind IN ('base', 'add_on') | ||
active | BOOLEAN | no | inactive templates can't be picked for a new onboarding |
- Unique index
templates_name_uniqon(LOWER(name)) - App rule (R6): a base template always has at least one task.
template_tasks
One task in a template.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
template_id | TEXT | no | References templates.id | ||
title | TEXT | no | Check: LENGTH(title) BETWEEN 1 AND 120 | ||
description | TEXT | yes | optionalCheck: LENGTH(description) <= 1000 | ||
owner_role | TEXT | no | Check: owner_role IN ('manager', 'it', 'people', 'buddy', 'new_hire') | ||
offset_days | INTEGER | no | 0 is the start date; negative is before itCheck: offset_days BETWEEN -60 AND 120 | ||
is_check_in | BOOLEAN | no | check-ins collect a private note when completed | ||
position | INTEGER | no | task order within the template |
- Table check:
is_check_in = FALSE OR owner_role IN ('manager', 'people') - Index
template_tasks_template_idxon(template_id, position)
onboardings
One new hire's onboarding.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
new_hire_id | TEXT | no | References people.id | ||
manager_id | TEXT | no | References people.id | copied from the new hire at creation; decides who reads check-in notes | |
buddy_id | TEXT | yes | References people.id | ||
start_date | DATE | no | |||
title | TEXT | yes | copied from the new hire's title at creation, e.g. "Account Executive" | ||
status | TEXT | no | Check: status IN ('upcoming', 'in_progress', 'completed', 'cancelled') | ||
cancel_reason | TEXT | yes | seen only by the people team and the managerCheck: LENGTH(cancel_reason) BETWEEN 3 AND 200 | ||
created_by | TEXT | no | References people.id | ||
created_at | TIMESTAMP | no |
- Table check:
buddy_id <> new_hire_id - Table check:
(status = 'cancelled' AND cancel_reason IS NOT NULL) OR (status <> 'cancelled' AND cancel_reason IS NULL) - Unique index
onboardings_one_liveon(new_hire_id)wherestatus IN ('upcoming', 'in_progress') - App rule (R3): creation is refused when a task needs a buddy and none is chosen, or the new hire has no active manager.
- App rule (R9): completed automatically when every task is done or skipped; a cancelled onboarding is read-only.
onboarding_templates
One template name copied onto an onboarding (child table of Onboarding.template_names).
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
onboarding_id | TEXT | no | Primary key (part); References onboardings.id | ||
position | INTEGER | no | Primary key (part) | 1 is the base template, then add-ons in name order | |
template_name | TEXT | no | copied name; later renames never change it |
tasks
One task on an onboarding, copied once from a template (section 7).
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
onboarding_id | TEXT | no | References onboardings.id | ||
title | TEXT | no | Check: LENGTH(title) BETWEEN 1 AND 120 | ||
description | TEXT | yes | Check: LENGTH(description) <= 1000 | ||
owner_role | TEXT | no | Check: owner_role IN ('manager', 'it', 'people', 'buddy', 'new_hire') | ||
owner_id | TEXT | no | References people.id | resolved from owner_role at creation (R3) | |
offset_days | INTEGER | no | Check: offset_days BETWEEN -60 AND 120 | ||
due_date | DATE | no | |||
is_check_in | BOOLEAN | no | |||
position | INTEGER | no | the order the task was copied in | ||
status | TEXT | no | Check: status IN ('open', 'done', 'skipped') | ||
done_at | TIMESTAMP | yes | |||
done_by | TEXT | yes | References people.id | ||
skip_reason | TEXT | yes | Check: LENGTH(skip_reason) BETWEEN 3 AND 200 | ||
check_in_note | TEXT | yes | kept when a check-in is reopenedCheck: LENGTH(check_in_note) BETWEEN 5 AND 2000 |
- Table check:
is_check_in = FALSE OR owner_role IN ('manager', 'people') - Table check:
status <> 'open' OR (done_at IS NULL AND done_by IS NULL AND skip_reason IS NULL) - Table check:
status <> 'done' OR (done_at IS NOT NULL AND done_by IS NOT NULL AND skip_reason IS NULL) - Table check:
status <> 'skipped' OR skip_reason IS NOT NULL - Table check:
is_check_in = TRUE OR check_in_note IS NULL - Table check:
is_check_in = FALSE OR status <> 'done' OR check_in_note IS NOT NULL - Index
tasks_onboarding_idxon(onboarding_id, position) - Index
tasks_owner_idxon(owner_id, status, due_date) - App rule (R2): due_date = start_date + offset_days, moved to the Friday before when it falls on a weekend; open tasks are recalculated when the start date moves.
- App rule (R8): check-in notes are visible only to the onboarding's manager and the people team, never in emails, events or exports.
events
One append-only activity entry on an onboarding. Never edited or deleted.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
onboarding_id | TEXT | no | References onboardings.id | ||
actor_id | TEXT | yes | References people.id | empty for the system | |
type | TEXT | no | Check: type IN ('created', 'start_date_moved', 'task_done', 'task_reopened', 'task_skipped', 'task_reassigned', 'cancelled', 'completed', 'reminded') | ||
data | TEXT | yes | JSON text, e.g. old and new start date; never a check-in note or cancel reason | ||
created_at | TIMESTAMP | no |
- Index
events_onboarding_idxon(onboarding_id, created_at) - App rule (R13): template, people and settings changes are not logged as events.
notifications
One outgoing email in the outbox.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
kind | TEXT | no | Check: kind IN ('digest', 'pre_start', 'assigned', 'cancelled') | ||
to_email | TEXT | no | |||
person_id | TEXT | no | References people.id | ||
onboarding_id | TEXT | yes | References onboardings.id | ||
subject | TEXT | no | |||
body | TEXT | no | |||
status | TEXT | no | logged = no email provider configuredCheck: status IN ('pending', 'sent', 'logged', 'failed') | ||
error | TEXT | yes | |||
created_at | TIMESTAMP | no | |||
sent_at | TIMESTAMP | yes |
- Index
notifications_status_idxon(status, created_at) - App rule (R9): cancelling an onboarding deletes its pending and failed rows.
digest_runs
One daily digest already queued for a person; a person never gets two on the same day.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
person_id | TEXT | no | Primary key (part); References people.id | ||
date | DATE | no | Primary key (part) | team date |
The SQL
The whole schema in one file. It runs top to bottom, unmodified, on SQLite and PostgreSQL. Download employee-onboarding.sql or copy it from here.
-- Employee Onboarding database schema
-- Source: https://personalsoftwarefactory.com/blueprints/employee-onboarding (data model, section 5 of the blueprint)
-- Verified on SQLite 3.53.4 and PostgreSQL 19.0 (PGlite). All timestamps are UTC.
-- License: MIT. Free to copy and adapt.
-- A person at the company: a team member, a manager, a buddy or a new hire. Deactivated, never deleted.
-- App rule (section 5): manager_id must be active and must not create a reporting loop; changing it never changes existing onboardings.
-- App rule (R12): people who own open tasks on upcoming or in-progress onboardings, and the current IT and people owners, can't be deactivated.
CREATE TABLE people (
id TEXT PRIMARY KEY,
name TEXT NOT NULL CHECK (LENGTH(name) BETWEEN 1 AND 100),
email TEXT NOT NULL UNIQUE CHECK (email = LOWER(email)), -- stored lowercase
title TEXT CHECK (LENGTH(title) <= 100), -- optional
manager_id TEXT REFERENCES people(id),
is_people_team BOOLEAN NOT NULL,
active BOOLEAN NOT NULL,
start_date DATE, -- set for new hires; they cannot sign in before it
CHECK (manager_id <> id) -- never the person themself
);
-- The single settings row. Comes after people because it names the IT and people owners.
CREATE TABLE settings (
id INTEGER PRIMARY KEY CHECK (id = 1), -- one row only
company_name TEXT NOT NULL,
time_zone TEXT NOT NULL, -- IANA name; "today" and every date are in this zone
it_owner_id TEXT NOT NULL REFERENCES people(id), -- receives it-role tasks; must be active (R12)
people_owner_id TEXT NOT NULL REFERENCES people(id), -- receives people-role tasks; must be active (R12)
digest_hour INTEGER NOT NULL DEFAULT 8 CHECK (digest_hour BETWEEN 0 AND 23) -- team time
);
-- A checklist template: one base template per onboarding, plus any add-ons. Deactivated, never deleted.
-- App rule (R6): a base template always has at least one task.
CREATE TABLE templates (
id TEXT PRIMARY KEY,
name TEXT NOT NULL CHECK (LENGTH(name) BETWEEN 1 AND 80),
kind TEXT NOT NULL CHECK (kind IN ('base', 'add_on')),
active BOOLEAN NOT NULL -- inactive templates can't be picked for a new onboarding
);
CREATE UNIQUE INDEX templates_name_uniq ON templates (LOWER(name)); -- unique ignoring case
-- One task in a template.
CREATE TABLE template_tasks (
id TEXT PRIMARY KEY,
template_id TEXT NOT NULL REFERENCES templates(id),
title TEXT NOT NULL CHECK (LENGTH(title) BETWEEN 1 AND 120),
description TEXT CHECK (LENGTH(description) <= 1000), -- optional
owner_role TEXT NOT NULL CHECK (owner_role IN ('manager', 'it', 'people', 'buddy', 'new_hire')),
offset_days INTEGER NOT NULL CHECK (offset_days BETWEEN -60 AND 120), -- 0 is the start date; negative is before it
is_check_in BOOLEAN NOT NULL, -- check-ins collect a private note when completed
position INTEGER NOT NULL, -- task order within the template
CHECK (is_check_in = FALSE OR owner_role IN ('manager', 'people')) -- only they may read the note
);
CREATE INDEX template_tasks_template_idx ON template_tasks (template_id, position);
-- One new hire's onboarding.
-- App rule (R3): creation is refused when a task needs a buddy and none is chosen, or the new hire has no active manager.
-- App rule (R9): completed automatically when every task is done or skipped; a cancelled onboarding is read-only.
CREATE TABLE onboardings (
id TEXT PRIMARY KEY,
new_hire_id TEXT NOT NULL REFERENCES people(id),
manager_id TEXT NOT NULL REFERENCES people(id), -- copied from the new hire at creation; decides who reads check-in notes
buddy_id TEXT REFERENCES people(id),
start_date DATE NOT NULL,
title TEXT, -- copied from the new hire's title at creation, e.g. "Account Executive"
status TEXT NOT NULL CHECK (status IN ('upcoming', 'in_progress', 'completed', 'cancelled')),
cancel_reason TEXT CHECK (LENGTH(cancel_reason) BETWEEN 3 AND 200), -- seen only by the people team and the manager
created_by TEXT NOT NULL REFERENCES people(id),
created_at TIMESTAMP NOT NULL,
CHECK (buddy_id <> new_hire_id), -- the new hire can't be their own buddy
CHECK ((status = 'cancelled' AND cancel_reason IS NOT NULL) OR (status <> 'cancelled' AND cancel_reason IS NULL))
);
CREATE UNIQUE INDEX onboardings_one_live ON onboardings (new_hire_id) WHERE status IN ('upcoming', 'in_progress'); -- one live onboarding per person (section 7)
-- One template name copied onto an onboarding (child table of Onboarding.template_names).
CREATE TABLE onboarding_templates (
onboarding_id TEXT NOT NULL REFERENCES onboardings(id),
position INTEGER NOT NULL, -- 1 is the base template, then add-ons in name order
template_name TEXT NOT NULL, -- copied name; later renames never change it
PRIMARY KEY (onboarding_id, position)
);
-- One task on an onboarding, copied once from a template (section 7).
-- App rule (R2): due_date = start_date + offset_days, moved to the Friday before when it falls on a weekend; open tasks are recalculated when the start date moves.
-- App rule (R8): check-in notes are visible only to the onboarding's manager and the people team, never in emails, events or exports.
CREATE TABLE tasks (
id TEXT PRIMARY KEY,
onboarding_id TEXT NOT NULL REFERENCES onboardings(id),
title TEXT NOT NULL CHECK (LENGTH(title) BETWEEN 1 AND 120),
description TEXT CHECK (LENGTH(description) <= 1000),
owner_role TEXT NOT NULL CHECK (owner_role IN ('manager', 'it', 'people', 'buddy', 'new_hire')),
owner_id TEXT NOT NULL REFERENCES people(id), -- resolved from owner_role at creation (R3)
offset_days INTEGER NOT NULL CHECK (offset_days BETWEEN -60 AND 120),
due_date DATE NOT NULL,
is_check_in BOOLEAN NOT NULL,
position INTEGER NOT NULL, -- the order the task was copied in
status TEXT NOT NULL CHECK (status IN ('open', 'done', 'skipped')),
done_at TIMESTAMP,
done_by TEXT REFERENCES people(id),
skip_reason TEXT CHECK (LENGTH(skip_reason) BETWEEN 3 AND 200),
check_in_note TEXT CHECK (LENGTH(check_in_note) BETWEEN 5 AND 2000), -- kept when a check-in is reopened
CHECK (is_check_in = FALSE OR owner_role IN ('manager', 'people')),
CHECK (status <> 'open' OR (done_at IS NULL AND done_by IS NULL AND skip_reason IS NULL)), -- reopening clears them
CHECK (status <> 'done' OR (done_at IS NOT NULL AND done_by IS NOT NULL AND skip_reason IS NULL)),
CHECK (status <> 'skipped' OR skip_reason IS NOT NULL), -- skipping needs a reason (R4)
CHECK (is_check_in = TRUE OR check_in_note IS NULL), -- notes on check-ins only
CHECK (is_check_in = FALSE OR status <> 'done' OR check_in_note IS NOT NULL) -- R8: completing a check-in needs a note
);
CREATE INDEX tasks_onboarding_idx ON tasks (onboarding_id, position);
CREATE INDEX tasks_owner_idx ON tasks (owner_id, status, due_date);
-- One append-only activity entry on an onboarding. Never edited or deleted.
-- App rule (R13): template, people and settings changes are not logged as events.
CREATE TABLE events (
id TEXT PRIMARY KEY,
onboarding_id TEXT NOT NULL REFERENCES onboardings(id),
actor_id TEXT REFERENCES people(id), -- empty for the system
type TEXT NOT NULL CHECK (type IN ('created', 'start_date_moved', 'task_done', 'task_reopened', 'task_skipped', 'task_reassigned', 'cancelled', 'completed', 'reminded')),
data TEXT, -- JSON text, e.g. old and new start date; never a check-in note or cancel reason
created_at TIMESTAMP NOT NULL
);
CREATE INDEX events_onboarding_idx ON events (onboarding_id, created_at);
-- One outgoing email in the outbox.
-- App rule (R9): cancelling an onboarding deletes its pending and failed rows.
CREATE TABLE notifications (
id TEXT PRIMARY KEY,
kind TEXT NOT NULL CHECK (kind IN ('digest', 'pre_start', 'assigned', 'cancelled')),
to_email TEXT NOT NULL,
person_id TEXT NOT NULL REFERENCES people(id),
onboarding_id TEXT REFERENCES onboardings(id),
subject TEXT NOT NULL,
body TEXT NOT NULL,
status TEXT NOT NULL CHECK (status IN ('pending', 'sent', 'logged', 'failed')), -- logged = no email provider configured
error TEXT,
created_at TIMESTAMP NOT NULL,
sent_at TIMESTAMP
);
CREATE INDEX notifications_status_idx ON notifications (status, created_at);
-- One daily digest already queued for a person; a person never gets two on the same day.
CREATE TABLE digest_runs (
person_id TEXT NOT NULL REFERENCES people(id),
date DATE NOT NULL, -- team date
PRIMARY KEY (person_id, date)
);Seed data
Loads all of section 14 for a seed day of Tue 2026-10-13, the date the spec's examples assume: 9 people, the settings row, 3 templates with 17 template tasks, 3 onboardings with 5 copied template names and 45 tasks, and 14 events (3 created, 11 task_done). The spec gives no creation time for the onboardings; this file uses 09:00 team time 21 days before each start date. Events carry no data, because the spec does not define the JSON shape. The outbox and digest runs start empty.
Download employee-onboarding-seed.sql (97 rows). It loads with foreign keys enforced on both engines.
Load it
SQLite, into a new file:
curl -s https://personalsoftwarefactory.com/schemas/employee-onboarding.sql https://personalsoftwarefactory.com/schemas/employee-onboarding-seed.sql | sqlite3 employee_onboarding.dbPostgreSQL, into a new database:
createdb employee_onboarding && curl -s https://personalsoftwarefactory.com/schemas/employee-onboarding.sql https://personalsoftwarefactory.com/schemas/employee-onboarding-seed.sql | psql -v ON_ERROR_STOP=1 employee_onboardingSQLite only enforces foreign keys when the connection asks for it: run PRAGMA foreign_keys = ON; when your app opens the database.
Design decisions
Owners are roles in templates and people in tasks
Template tasks name a role; R3 resolves it once, at creation, to the new hire's manager, the IT or people owner from settings, the buddy or the new hire. tasks keeps both owner_role and owner_id, so a reassigned task still knows what kind of task it is, and changing settings or a person's manager never moves existing tasks (section 13).
Onboardings copy what they were created from
From the build test · field report
manager_id, title and the template names are copied at creation. The build test found Onboarding.title had no source; it is now the new hire's title at creation. manager_id stays as created even if the new hire's manager changes, because R11 and R8 use it to decide who reads check-in notes. The template names are a child table in copy order rather than a delimited string, since names may contain any character.
Tasks keep a position
From the build test · field report
Tasks are copied from the base template and then each add-on in name order, each in its template's order (section 7). The build test found Task had no position field, so that order was lost after copying; tasks.position stores it.
Check-ins are limited to manager and people tasks
From the build test · field report
Only the manager and the people team may read a check-in note (R8), so the build test fix limits check-ins to those roles. A CHECK on both template_tasks and tasks enforces it, another keeps notes on check-ins only, and a third requires a note on a done check-in. A reopened check-in keeps its note, so an open check-in may still have one.
One live onboarding per new hire
From the build test · field report
Section 7 lets the people team pick only a person with no upcoming or in-progress onboarding. A partial unique index on new_hire_id WHERE status IN ('upcoming', 'in_progress') enforces it, while completed and cancelled onboardings stay as history. The build test found the form didn't say who can be picked or whether a person can have two live onboardings; section 7 now limits it to one.
Digest runs make the job safe to repeat
Section 11 runs hourly and must never send a digest twice. digest_runs has the primary key (person_id, date) and is written in the same transaction as the queued digest, so a late or doubled run fails the insert instead of emailing again.
Example queries
The queries behind the tool's main screens. Each returned the same rows on both engines against the seed data.
Onboardings list with progress and overdue
SELECT p.name AS new_hire, o.title, o.start_date, o.status, SUM(CASE WHEN t.status IN ('done', 'skipped') THEN 1 ELSE 0 END) AS closed, COUNT(t.id) AS total, SUM(CASE WHEN t.status = 'open' AND o.status IN ('upcoming', 'in_progress') AND t.due_date < '2026-10-13' THEN 1 ELSE 0 END) AS overdue FROM onboardings o JOIN people p ON p.id = o.new_hire_id JOIN tasks t ON t.onboarding_id = o.id GROUP BY o.id, p.name, o.title, o.start_date, o.status ORDER BY o.start_date;On the seed data on 2026-10-13: 3 rows, Leo Grant in progress with 10 of 15 closed and 2 overdue, Priya Nair 1 of 16, Kai Brooks 0 of 14.
My tasks for Maya Chen
SELECT CASE WHEN t.due_date < '2026-10-13' THEN 'overdue' WHEN t.due_date = '2026-10-13' THEN 'today' WHEN t.due_date <= '2026-10-18' THEN 'this week' ELSE 'later' END AS task_group, t.title, h.name AS new_hire, o.start_date, t.due_date FROM tasks t JOIN onboardings o ON o.id = t.onboarding_id JOIN people h ON h.id = o.new_hire_id WHERE t.owner_id = 'person_maya' AND t.status = 'open' AND o.status IN ('upcoming', 'in_progress') ORDER BY t.due_date, t.position;On the seed data: 4 rows for Leo Grant, Set 30-60-90 day goals overdue (due 2026-10-09) and the 30-day, 60-day and 90-day check-ins later.
Who gets a digest today
SELECT p.name, SUM(CASE WHEN t.due_date < '2026-10-13' THEN 1 ELSE 0 END) AS overdue, SUM(CASE WHEN t.due_date = '2026-10-13' THEN 1 ELSE 0 END) AS due_today FROM tasks t JOIN onboardings o ON o.id = t.onboarding_id JOIN people p ON p.id = t.owner_id WHERE t.status = 'open' AND o.status IN ('upcoming', 'in_progress') AND t.due_date <= '2026-10-13' AND p.active = TRUE AND (p.start_date IS NULL OR p.start_date <= '2026-10-13') AND NOT EXISTS (SELECT 1 FROM digest_runs d WHERE d.person_id = p.id AND d.date = '2026-10-13') GROUP BY p.id, p.name ORDER BY p.name;On the seed data at 08:00 on 2026-10-13: 2 rows, Leo Grant (Complete security training) and Maya Chen, 1 overdue task each.
Onboarding screen for Priya Nair
SELECT CASE WHEN t.offset_days < 0 THEN 'Before day one' WHEN t.offset_days = 0 THEN 'Day one' WHEN t.offset_days <= 6 THEN 'First week' ELSE 'First 90 days' END AS task_group, t.title, p.name AS owner, t.due_date, t.status FROM tasks t JOIN people p ON p.id = t.owner_id WHERE t.onboarding_id = 'onboarding_priya' ORDER BY CASE WHEN t.offset_days < 0 THEN 1 WHEN t.offset_days = 0 THEN 2 WHEN t.offset_days <= 6 THEN 3 ELSE 4 END, t.due_date, t.position;On the seed data: 16 rows; Prepare desk or ship equipment is due 2026-10-23 (raw date Sun Oct 25) and the 90-day review 2027-01-22, as in section 6.
What was not tested
- MySQL, MariaDB, SQL Server and Oracle. The file avoids engine-specific syntax, but it was not run on them.
- Other versions of SQLite and PostgreSQL than the two named above.
- PostgreSQL as a server. The PostgreSQL run used PGlite, which is PostgreSQL compiled to run in-process.
- Production load. The check loads the seed rows and runs the example queries; it says nothing about performance with real volumes.
- Migrations. This is a schema for a new database, not a path from an existing one.
The blueprint this schema comes from
Tables are the easy half. This schema is section 5 of the Employee Onboarding blueprint, a free spec that also has the business rules, the screens, 4 phased build prompts and 20 acceptance checks for building the whole tool with an AI app builder. We built it from those prompts and the result passed 20 of 20 acceptance checks in a browser.
- Read the Employee Onboarding blueprint: rules, screens, build prompts and acceptance checks
- Read the build-test field report: what the test build got wrong and what was not tested
- All database schemas
- How we test blueprints
Follow new blueprints
Every new blueprint and build test appears in the feed and in the public GitHub repository. No account, no email list.