Timesheet management system database schema
Nine tables. weeks holds one timesheet per person per Monday with its status, the approver fixed at submission and a version for stale-action checks; entries hold minutes in 15-minute steps on one project and date. Rates live on projects and are copied onto entries only when a week is approved, so later rate changes never change approved hours. Budget burn counts only submitted and approved weeks.
- 9 tables, 3 indexes
- Verified on SQLite 3.53.4 and PostgreSQL 19.0 (PGlite 0.6.1),
- 62 seed rows from the blueprint
- The blueprint's test build passed 21 of 21 acceptance checks
Timesheets 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.
- projects.client_id references clients.id: each projects row points to at most one clients row, and one clients row can have many projects rows pointing to it.
- projects.owner_id references people.id: each projects row points to exactly one people row, and one people row can have many projects rows pointing to it.
- assignments.project_id references projects.id: each assignments row points to exactly one projects row, and one projects row can have many assignments rows pointing to it.
- assignments.person_id references people.id: each assignments row points to exactly one people row, and one people row can have many assignments rows pointing to it.
- weeks.person_id references people.id: each weeks row points to exactly one people row, and one people row can have many weeks rows pointing to it.
- weeks.approved_by references people.id: each weeks row points to at most one people row, and one people row can have many weeks rows pointing to it.
- weeks.approver_id references people.id: each weeks row points to at most one people row, and one people row can have many weeks rows pointing to it.
- entries.project_id references projects.id: each entries row points to exactly one projects row, and one projects row can have many entries rows pointing to it.
- entries.week_id, person_id references weeks.id, person_id: each entries row points to exactly one weeks row, and one weeks row can have many entries 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.
- events.week_id references weeks.id: each events row points to at most one weeks row, and one weeks row can have many events rows pointing to it.
- events.project_id references projects.id: each events row points to at most one projects row, and one projects row can have many events rows pointing to it.
- notifications.person_id references people.id: each notifications row points to at most one people row, and one people row can have many notifications rows pointing to it.
Timesheets tables
The schema has 9 tables. Every column below is read from the SQL file itself. Also described as: employee timesheet database design, time tracking database tables, timesheet approval data model.
| Table | Implements | What a row is |
|---|---|---|
people | Person | A person who logs time, with their manager, admin flag and weekly capacity. |
settings | Settings | The one row with the company name, sign-in domain, time zone and reminder day and time. |
clients | Client | A client that projects belong to. |
projects | Project | A project with its owner, billable rate, optional budget and budget warning times. |
assignments | Assignment | A person allowed to log time to a project. |
weeks | Week | One person's timesheet for one Monday-to-Sunday week, from draft to approved. |
entries | Entry | Minutes on one project on one date, with the rate copied at approval. |
events | Event | One action kept for the activity log, never edited or deleted. |
notifications | Notification | One email in the outbox with its status and attempt count. |
people
A person who logs time. manager_id is the approver of their weeks (R6).
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
name | TEXT | no | Check: length(name) BETWEEN 1 AND 80 | ||
email | TEXT | no | Unique | stored lowercaseCheck: email = lower(email) | |
manager_id | TEXT | yes | References people.id | never themselvesCheck: manager_id <> id | |
is_admin | BOOLEAN | no | FALSE | ||
active | BOOLEAN | no | TRUE | ||
weekly_capacity_minutes | INTEGER | no | 2400 | 0 to 168 hours; only for the "under hours" note in remindersCheck: weekly_capacity_minutes BETWEEN 0 AND 10080 |
- App rule: no manager loops. App rule (R12): nobody deactivates themselves or the last active admin.
settings
The single settings row. id is fixed at 1 so the table can never hold a second row.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | INTEGER | no | Primary key | Check: id = 1 | |
company_name | TEXT | no | |||
email_domain | TEXT | no | sign-in is limited to this domain | ||
time_zone | TEXT | no | 'America/New_York' | IANA name; weeks run Monday to Sunday in this zone | |
reminder_weekday | TEXT | no | 'Friday' | Check: reminder_weekday IN ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday') | |
reminder_time | TEXT | no | '15:00' | 24-hour HH:MM in the team time zone |
clients
A client that projects bill to. Archiving a client archives its projects (R5).
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
name | TEXT | no | Unique | Check: length(name) BETWEEN 1 AND 80 | |
archived | BOOLEAN | no | FALSE |
projects
A project people log time to. Internal projects have no client.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
client_id | TEXT | yes | References clients.id | NULL for internal projects | |
name | TEXT | no | Check: length(name) BETWEEN 1 AND 80 | ||
owner_id | TEXT | no | References people.id | sees all hours and gets budget warnings | |
billable | BOOLEAN | no | |||
rate_cents | INTEGER | yes | per hour, $0.00 to $1,000.00; NULL for non-billable projectsCheck: rate_cents BETWEEN 0 AND 100000 | ||
budget_minutes | INTEGER | yes | 0.25 h steps; NULL means no budgetCheck: budget_minutes > 0 AND budget_minutes % 15 = 0 | ||
archived | BOOLEAN | no | FALSE | ||
warned_80_at | TIMESTAMP | yes | when the 80% budget warning went (R10) | ||
warned_100_at | TIMESTAMP | yes | when the 100% budget warning went (R10) |
- Unique together:
client_id, name - Table check:
(billable = TRUE AND rate_cents IS NOT NULL) OR (billable = FALSE AND rate_cents IS NULL) - Unique index
projects_internal_name_uniqueon(name)whereclient_id IS NULL - App rule: owner_id must be an active person.
assignments
A person assigned to a project. Only assigned people can log time to it (R2).
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
project_id | TEXT | no | Primary key (part); References projects.id | ||
person_id | TEXT | no | Primary key (part); References people.id |
weeks
The timesheet of one person for one week. A missing row means a draft week with no entries.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
person_id | TEXT | no | References people.id | ||
week_start | DATE | no | the Monday | ||
status | TEXT | no | 'draft' | Check: status IN ('draft', 'submitted', 'approved') | |
submitted_at | TIMESTAMP | yes | |||
approved_at | TIMESTAMP | yes | |||
approved_by | TEXT | yes | References people.id | ||
approver_id | TEXT | yes | References people.id | the only person who can approve or reject this submission | |
empty_note | TEXT | yes | e.g. "On leave"Check: length(empty_note) BETWEEN 5 AND 200 | ||
reminded_on | DATE | yes | the date of the last reminder about this week (R11) | ||
version | INTEGER | no | 1 | R13: up by 1 on every change to the week or its entriesCheck: version >= 1 |
- Unique together:
person_id, week_start - Unique together:
id, person_id - Table check:
approver_id <> person_id - Table check:
(status = 'draft' AND submitted_at IS NULL AND approver_id IS NULL AND approved_at IS NULL AND approved_by IS NULL) OR (status = 'submitted' AND submitted_at IS NOT NULL AND approver_id IS NOT NULL AND approved_at IS NULL AND approved_by IS NULL) OR (status = 'approved' AND submitted_at IS NOT NULL AND approver_id IS NOT NULL AND approved_at IS NOT NULL AND approved_by IS NOT NULL) - App rule: week_start is always a Monday. App rule (R6): approver_id is set at submission and never the person.
- App rule: submitting a week with no entries needs empty_note.
entries
Time on one project on one day. Locked while its week is submitted or approved (R3).
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
week_id | TEXT | no | |||
person_id | TEXT | no | |||
project_id | TEXT | no | References projects.id | ||
date | DATE | no | |||
minutes | INTEGER | no | Check: minutes BETWEEN 15 AND 1440 AND minutes % 15 = 0 | ||
note | TEXT | yes | Check: length(note) <= 300 | ||
rate_cents | INTEGER | yes | copied from the project when the week is approved (R9); NULL beforeCheck: rate_cents BETWEEN 0 AND 100000 |
- Index
entries_project_dateon(project_id, date) - App rule (R1): the total of a person for one date is at most 1,440 minutes, and dates cannot be after today.
- App rule (R4): date falls inside its week.
events
One action, kept for the activity log. Append-only (R14).
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
actor_id | TEXT | yes | References people.id | NULL for the system | |
week_id | TEXT | yes | References weeks.id | ||
project_id | TEXT | yes | References projects.id | ||
type | TEXT | no | Check: type IN ('entry_added', 'entry_edited', 'entry_deleted', 'submitted', 'withdrawn', 'approved', 'rejected', 'approval_withdrawn', 'budget_warning', 'reminded', 'project_changed', 'person_changed', 'client_changed', 'settings_changed', 'approver_reassigned') | ||
data | TEXT | no | '{}' | JSON stored as text | |
created_at | TIMESTAMP | no |
notifications
One email in the outbox. Written first, then sent; a failure never blocks the action.
| Column | Type | Null | Default | Key | Notes |
|---|---|---|---|---|---|
id | TEXT | no | Primary key | ||
kind | TEXT | no | |||
to_email | TEXT | no | |||
person_id | TEXT | yes | References people.id | ||
subject | TEXT | no | |||
body | TEXT | no | |||
status | TEXT | no | 'pending' | Check: status IN ('pending', 'sent', 'logged', 'failed') | |
error | TEXT | yes | |||
attempts | INTEGER | no | 0 | up to 3 attempts in allCheck: attempts BETWEEN 0 AND 3 | |
created_at | TIMESTAMP | no | |||
sent_at | TIMESTAMP | yes |
- Index
notifications_statuson(status)
The SQL
The whole schema in one file. It runs top to bottom, unmodified, on SQLite and PostgreSQL. Download timesheets.sql or copy it from here.
-- Timesheets database schema
-- Source: https://personalsoftwarefactory.com/blueprints/timesheets (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 who logs time. manager_id is the approver of their weeks (R6).
-- App rule: no manager loops. App rule (R12): nobody deactivates themselves or the last active admin.
CREATE TABLE people (
id TEXT PRIMARY KEY,
name TEXT NOT NULL CHECK (length(name) BETWEEN 1 AND 80),
email TEXT NOT NULL UNIQUE CHECK (email = lower(email)), -- stored lowercase
manager_id TEXT REFERENCES people(id) CHECK (manager_id <> id), -- never themselves
is_admin BOOLEAN NOT NULL DEFAULT FALSE,
active BOOLEAN NOT NULL DEFAULT TRUE,
weekly_capacity_minutes INTEGER NOT NULL DEFAULT 2400 CHECK (weekly_capacity_minutes BETWEEN 0 AND 10080) -- 0 to 168 hours; only for the "under hours" note in reminders
);
-- The single settings row. id is fixed at 1 so the table can never hold a second row.
CREATE TABLE settings (
id INTEGER PRIMARY KEY CHECK (id = 1),
company_name TEXT NOT NULL,
email_domain TEXT NOT NULL, -- sign-in is limited to this domain
time_zone TEXT NOT NULL DEFAULT 'America/New_York', -- IANA name; weeks run Monday to Sunday in this zone
reminder_weekday TEXT NOT NULL DEFAULT 'Friday' CHECK (reminder_weekday IN ('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday')),
reminder_time TEXT NOT NULL DEFAULT '15:00' -- 24-hour HH:MM in the team time zone
);
-- A client that projects bill to. Archiving a client archives its projects (R5).
CREATE TABLE clients (
id TEXT PRIMARY KEY,
name TEXT NOT NULL UNIQUE CHECK (length(name) BETWEEN 1 AND 80),
archived BOOLEAN NOT NULL DEFAULT FALSE
);
-- A project people log time to. Internal projects have no client.
-- App rule: owner_id must be an active person.
CREATE TABLE projects (
id TEXT PRIMARY KEY,
client_id TEXT REFERENCES clients(id), -- NULL for internal projects
name TEXT NOT NULL CHECK (length(name) BETWEEN 1 AND 80),
owner_id TEXT NOT NULL REFERENCES people(id), -- sees all hours and gets budget warnings
billable BOOLEAN NOT NULL,
rate_cents INTEGER CHECK (rate_cents BETWEEN 0 AND 100000), -- per hour, $0.00 to $1,000.00; NULL for non-billable projects
budget_minutes INTEGER CHECK (budget_minutes > 0 AND budget_minutes % 15 = 0), -- 0.25 h steps; NULL means no budget
archived BOOLEAN NOT NULL DEFAULT FALSE,
warned_80_at TIMESTAMP, -- when the 80% budget warning went (R10)
warned_100_at TIMESTAMP, -- when the 100% budget warning went (R10)
UNIQUE (client_id, name), -- unique within the client
CHECK ((billable = TRUE AND rate_cents IS NOT NULL) OR (billable = FALSE AND rate_cents IS NULL))
);
CREATE UNIQUE INDEX projects_internal_name_unique ON projects (name) WHERE client_id IS NULL; -- unique among internal projects too
-- A person assigned to a project. Only assigned people can log time to it (R2).
CREATE TABLE assignments (
project_id TEXT NOT NULL REFERENCES projects(id),
person_id TEXT NOT NULL REFERENCES people(id),
PRIMARY KEY (project_id, person_id)
);
-- The timesheet of one person for one week. A missing row means a draft week with no entries.
-- App rule: week_start is always a Monday. App rule (R6): approver_id is set at submission and never the person.
-- App rule: submitting a week with no entries needs empty_note.
CREATE TABLE weeks (
id TEXT PRIMARY KEY,
person_id TEXT NOT NULL REFERENCES people(id),
week_start DATE NOT NULL, -- the Monday
status TEXT NOT NULL DEFAULT 'draft' CHECK (status IN ('draft', 'submitted', 'approved')),
submitted_at TIMESTAMP,
approved_at TIMESTAMP,
approved_by TEXT REFERENCES people(id),
approver_id TEXT REFERENCES people(id), -- the only person who can approve or reject this submission
empty_note TEXT CHECK (length(empty_note) BETWEEN 5 AND 200), -- e.g. "On leave"
reminded_on DATE, -- the date of the last reminder about this week (R11)
version INTEGER NOT NULL DEFAULT 1 CHECK (version >= 1), -- R13: up by 1 on every change to the week or its entries
UNIQUE (person_id, week_start),
UNIQUE (id, person_id), -- lets entries check that their person owns the week
CHECK (approver_id <> person_id),
CHECK ((status = 'draft' AND submitted_at IS NULL AND approver_id IS NULL AND approved_at IS NULL AND approved_by IS NULL)
OR (status = 'submitted' AND submitted_at IS NOT NULL AND approver_id IS NOT NULL AND approved_at IS NULL AND approved_by IS NULL)
OR (status = 'approved' AND submitted_at IS NOT NULL AND approver_id IS NOT NULL AND approved_at IS NOT NULL AND approved_by IS NOT NULL))
);
-- Time on one project on one day. Locked while its week is submitted or approved (R3).
-- App rule (R1): the total of a person for one date is at most 1,440 minutes, and dates cannot be after today.
-- App rule (R4): date falls inside its week.
CREATE TABLE entries (
id TEXT PRIMARY KEY,
week_id TEXT NOT NULL,
person_id TEXT NOT NULL,
project_id TEXT NOT NULL REFERENCES projects(id),
date DATE NOT NULL,
minutes INTEGER NOT NULL CHECK (minutes BETWEEN 15 AND 1440 AND minutes % 15 = 0),
note TEXT CHECK (length(note) <= 300),
rate_cents INTEGER CHECK (rate_cents BETWEEN 0 AND 100000), -- copied from the project when the week is approved (R9); NULL before
FOREIGN KEY (week_id, person_id) REFERENCES weeks(id, person_id)
);
CREATE INDEX entries_project_date ON entries (project_id, date);
-- One action, kept for the activity log. Append-only (R14).
CREATE TABLE events (
id TEXT PRIMARY KEY,
actor_id TEXT REFERENCES people(id), -- NULL for the system
week_id TEXT REFERENCES weeks(id),
project_id TEXT REFERENCES projects(id),
type TEXT NOT NULL CHECK (type IN ('entry_added', 'entry_edited', 'entry_deleted', 'submitted', 'withdrawn', 'approved', 'rejected', 'approval_withdrawn', 'budget_warning', 'reminded', 'project_changed', 'person_changed', 'client_changed', 'settings_changed', 'approver_reassigned')),
data TEXT NOT NULL DEFAULT '{}', -- JSON stored as text
created_at TIMESTAMP NOT NULL
);
-- One email in the outbox. Written first, then sent; a failure never blocks the action.
CREATE TABLE notifications (
id TEXT PRIMARY KEY,
kind TEXT NOT NULL,
to_email TEXT NOT NULL,
person_id TEXT REFERENCES people(id),
subject TEXT NOT NULL,
body TEXT NOT NULL,
status TEXT NOT NULL DEFAULT 'pending' CHECK (status IN ('pending', 'sent', 'logged', 'failed')),
error TEXT,
attempts INTEGER NOT NULL DEFAULT 0 CHECK (attempts BETWEEN 0 AND 3), -- up to 3 attempts in all
created_at TIMESTAMP NOT NULL,
sent_at TIMESTAMP
);
CREATE INDEX notifications_status ON notifications (status);Seed data
Loads section 14 as of Tue 13 Oct 2026: settings, 6 people, 2 clients, 3 projects, 12 assignments, 7 weeks and 31 entries, with Website redesign's 80% warning recorded as sent. Lee's week of Oct 5 is laid out exactly as given; the other weeks follow the stated rule (Monday to Friday, at most 8 h a day, projects in table order), which the Oct 5 example itself does not follow. No events or emails are loaded: the spec lists none.
Download timesheets-seed.sql (62 rows). It loads with foreign keys enforced on both engines.
Load it
SQLite, into a new file:
curl -s https://personalsoftwarefactory.com/schemas/timesheets.sql https://personalsoftwarefactory.com/schemas/timesheets-seed.sql | sqlite3 timesheets.dbPostgreSQL, into a new database:
createdb timesheets && curl -s https://personalsoftwarefactory.com/schemas/timesheets.sql https://personalsoftwarefactory.com/schemas/timesheets-seed.sql | psql -v ON_ERROR_STOP=1 timesheetsSQLite only enforces foreign keys when the connection asks for it: run PRAGMA foreign_keys = ON; when your app opens the database.
Design decisions
Durations are integer minutes in 15-minute steps
From the build test · field report
entries.minutes is checked to 15 to 1,440 and a multiple of 15, as R1 says, and budgets are minutes in 0.25-hour steps (R8). Storing decimal hours would let 1.33 h through and make sums drift; the build test found the form also has to accept typed values, so the database is the last line that refuses 1:40.
The rate is copied onto entries at approval
entries.rate_cents is NULL until the week is approved and then holds the project's rate at that moment (R9). Reports use the entry's rate when it is set and the project's current rate otherwise, so a rate change to $160 leaves Lee's approved week at $150. Withdrawing approval clears it again.
Week status and its fields must agree
From the build test · field report
One CHECK ties status to submitted_at, approver_id, approved_at and approved_by: a draft has none, a submitted week has the first two, an approved week has all four. The build test found R13 never said what reject and withdraw clear; they now clear submitted_at and approver_id, and withdraw approval also clears approved_at and approved_by, which is what the CHECK expects.
The approver is fixed at submission
From the build test · field report
weeks.approver_id is set when the week is submitted and is never the week's own person, enforced by a CHECK. The build test found it unclear whether a manager assigned later could decide a week; R6 now says only the approver recorded at submission can, so it is a column on the week, not a lookup of the current manager.
Entries can't point at someone else's week
Entry has both week_id and person_id, so a composite foreign key from (week_id, person_id) to weeks(id, person_id) makes the two agree. Without it an entry could sit on Jo's week with Lee as its person, and R7's rule that nobody edits another person's entries would have nothing to stand on.
Budget warnings are timestamps that never re-arm on their own
From the build test · field report
projects.warned_80_at and warned_100_at record when each warning went (R10). The build test found nothing said whether a warning can be sent again: rejections and withdrawals never re-arm it, and only changing budget_minutes clears a timestamp when burn under the new budget is below that level.
Example queries
The queries behind the tool's main screens. Each returned the same rows on both engines against the seed data.
Budget burn by project
SELECT COALESCE(c.name, 'Internal') AS client, p.name AS project, p.budget_minutes,
COALESCE(SUM(CASE WHEN w.status IN ('submitted', 'approved') THEN e.minutes END), 0) AS used_minutes,
COALESCE(SUM(CASE WHEN w.status = 'draft' THEN e.minutes END), 0) AS draft_minutes,
CASE WHEN p.budget_minutes IS NULL THEN NULL
ELSE COALESCE(SUM(CASE WHEN w.status IN ('submitted', 'approved') THEN e.minutes END), 0) * 100 / p.budget_minutes
END AS burn_pct
FROM projects p
LEFT JOIN clients c ON c.id = p.client_id
LEFT JOIN entries e ON e.project_id = p.id
LEFT JOIN weeks w ON w.id = e.week_id
GROUP BY c.name, p.name, p.budget_minutes
ORDER BY client, project;On the seed data: 3 rows; Acme Corp Website redesign has 5,760 minutes (96 h) used of 7,200, 80%, plus 360 draft minutes.
Billable value of submitted and approved time
SELECT p.name AS project,
SUM(e.minutes) AS billable_minutes,
SUM((2 * e.minutes * COALESCE(e.rate_cents, p.rate_cents) + 60) / 120) AS value_cents
FROM entries e
JOIN weeks w ON w.id = e.week_id
JOIN projects p ON p.id = e.project_id
WHERE p.billable = TRUE AND w.status IN ('submitted', 'approved')
GROUP BY p.name
ORDER BY p.name;On the seed data: 2 rows; Website redesign is 1,440,000 cents ($14,400.00) and Brand refresh 315,000 cents ($3,150.00).
Approvals waiting for a manager
SELECT per.name AS person, w.week_start,
COALESCE(SUM(e.minutes), 0) AS total_minutes,
COALESCE(SUM(CASE WHEN p.billable = TRUE THEN e.minutes ELSE 0 END), 0) AS billable_minutes
FROM weeks w
JOIN people per ON per.id = w.person_id
JOIN people apr ON apr.id = w.approver_id
LEFT JOIN entries e ON e.week_id = w.id
LEFT JOIN projects p ON p.id = e.project_id
WHERE w.status = 'submitted' AND apr.email = 'maya@fernway.example'
GROUP BY per.name, w.week_start, w.submitted_at
ORDER BY w.submitted_at, per.name;On the seed data, for Maya Chen: 1 row; Jo Park's week of 2026-10-05 with 2,280 minutes (38 h), 510 of them billable.
Every timesheet with its status and total
SELECT per.name AS person, w.week_start, w.status,
COALESCE(apr.name, '') AS approver,
COALESCE(SUM(e.minutes), 0) AS total_minutes
FROM weeks w
JOIN people per ON per.id = w.person_id
LEFT JOIN people apr ON apr.id = w.approver_id
LEFT JOIN entries e ON e.week_id = w.id
GROUP BY per.name, w.week_start, w.status, apr.name
ORDER BY w.week_start, per.name;On the seed data: 7 rows; Ben Cho's week of 2026-10-05 is a draft with 0 minutes.
Approved entries export for a date range
SELECT e.date, COALESCE(c.name, 'Internal') AS client, p.name AS project, per.name AS person, e.minutes,
e.rate_cents,
CASE WHEN e.rate_cents IS NULL THEN NULL ELSE (2 * e.minutes * e.rate_cents + 60) / 120 END AS value_cents
FROM entries e
JOIN weeks w ON w.id = e.week_id
JOIN projects p ON p.id = e.project_id
LEFT JOIN clients c ON c.id = p.client_id
JOIN people per ON per.id = e.person_id
WHERE w.status = 'approved' AND e.date BETWEEN '2026-10-05' AND '2026-10-11'
ORDER BY e.date, client, project, person;On the seed data, for 5 to 11 Oct 2026: 9 rows, all Lee Park's; the Website redesign entry on 2026-10-05 is 420 minutes worth 105,000 cents.
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 Timesheets blueprint, a free spec that also has the business rules, the screens, 4 phased build prompts and 21 acceptance checks for building the whole tool with an AI app builder. We built it from those prompts and the result passed 21 of 21 acceptance checks in a browser.
- Read the Timesheets 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.