Project status tracking database schema

A weekly project status board needs six tables: people, settings, projects, updates, activities and notifications. The design is carried by updates, with a unique key on (project_id, week_start) so each project has at most one health and note per week and a second save revises it. A missing update is never stored: it is a week where an active project that had started has no row.

  • 6 tables, 5 indexes
  • Verified on SQLite 3.53.4 and PostgreSQL 19.0 (PGlite 0.6.1),
  • 42 seed rows from the blueprint
  • The blueprint's test build passed 28 of 28 acceptance checks

Copy the SQLDownload SQLDownload seed data

By Sam Claassen · From the Project Status Board blueprint · MIT licensed · Markdown version

Project status board entity-relationship diagram

peopleidPK+ 4 more columnssettingsidPK+ 8 more columnsprojectsidPKowner_id→ peoplecreated_by→ people+ 5 more columnsupdatesidPKproject_id→ projectsposted_by→ people+ 5 more columnsactivitiesidPKproject_id→ projectsactor_id→ people+ 3 more columnsnotificationsidPKperson_id→ people+ 10 more columnspeopleidPK+ 4 more columnssettingsidPK+ 8 more columnsprojectsidPKowner_id→ peoplecreated_by→ people+ 5 more columnsupdatesidPKproject_id→ projectsposted_by→ people+ 5 more columnsactivitiesidPKproject_id→ projectsactor_id→ people+ 3 more columnsnotificationsidPKperson_id→ people+ 10 more columns
Each box is a table with its key columns. A line runs from a table up to a table it references, with the forked end on the side that has many rows; a dashed line is an optional reference.

Relationships

  • 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.
  • projects.created_by references people.id: each projects row points to exactly one people row, and one people row can have many projects rows pointing to it.
  • updates.project_id references projects.id: each updates row points to exactly one projects row, and one projects row can have many updates rows pointing to it.
  • updates.posted_by references people.id: each updates row points to exactly one people row, and one people row can have many updates rows pointing to it.
  • activities.project_id references projects.id: each activities row points to exactly one projects row, and one projects row can have many activities rows pointing to it.
  • activities.actor_id references people.id: each activities row points to exactly one people row, and one people row can have many activities 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.

Project status board tables

The schema has 6 tables. Every column below is read from the SQL file itself. Also described as: weekly status report database design, project health tracker tables, RAG status board data model.

TableImplementsWhat a row is
peoplePersonOne row per person on the team, with their admin flag and whether they are active.
settingsSettingsThe single row of team settings: name, time zone, update day, reminder and report times, report recipients.
projectsProjectOne row per project, with its owner, target date, start week and archive time.
updatesUpdateOne row per project per week: the owner's health, note and revision count.
activitiesActivityOne row per action on a project, in an append-only log.
notificationsNotificationOne row per reminder, report or owner-change email, written before sending.

people

One row per person on the team.

ColumnTypeNullDefaultKeyNotes
idTEXTnoPrimary key
nameTEXTnoCheck: length(name) >= 1
emailTEXTnoUniquestored lowercaseCheck: email = lower(email)
is_adminBOOLEANnoFALSE
activeBOOLEANnoTRUE
  • App rule (R10): deactivating someone who owns an active project is refused, and there must always be at least one active admin.

settings

The single settings row for the one team and board.

ColumnTypeNullDefaultKeyNotes
idINTEGERnoPrimary keyone row onlyCheck: id = 1
team_nameTEXTnoused in the report titleCheck: length(team_name) BETWEEN 1 AND 60
time_zoneTEXTno'America/New_York'IANA name; decides today, weeks and job times
update_weekdayINTEGERno11 = Monday to 7 = SundayCheck: update_weekday BETWEEN 1 AND 7
reminder_timeTEXTno'09:00'HH:MM, 24-hour, team timeCheck: reminder_time LIKE '__:__' AND reminder_time BETWEEN '00:00' AND '23:59' AND substr(reminder_time, 4, 2) < '60'
report_timeTEXTno'15:00'HH:MM, 24-hour, team timeCheck: report_time LIKE '__:__' AND report_time BETWEEN '00:00' AND '23:59' AND substr(report_time, 4, 2) < '60'
report_recipientsTEXTno''email addresses separated by commas; empty means the scheduled report is skipped
last_reminder_weekDATEyeswritten only by the scheduled job: the Monday of the last week reminded
last_report_weekDATEyeswritten only by the scheduled job: the Monday of the last week reported
  • Table check: report_time > reminder_time

projects

One row per project on the board. Projects are archived, never deleted.

ColumnTypeNullDefaultKeyNotes
idTEXTnoPrimary key
nameTEXTnotrimmed; unique ignoring case across active and archived projects (index below)Check: length(name) BETWEEN 1 AND 100
owner_idTEXTnoReferences people.id
target_dateDATEnomay be in the past; the board then shows past target date (R13)
start_weekDATEnoalways a Monday: the week the project was created; never edited
archived_atTIMESTAMPyesempty while active
created_byTEXTnoReferences people.id
created_atTIMESTAMPnoCURRENT_TIMESTAMP
  • Unique index projects_name_idx on (lower(name)). Project names are unique ignoring case (R8).
  • Index projects_owner_idx on (owner_id)
  • App rule (R9): only the owner or an admin can edit, change the owner, archive or restore.
  • App rule (R10): owner_id must point at an active person.
  • App rule (R7): an archived project is read-only and left out of the board, missing counts, reminders and reports.

updates

One row per project per week: the owner's health and note for that week. Revising replaces the row's values.

ColumnTypeNullDefaultKeyNotes
idTEXTnoPrimary key
project_idTEXTnoReferences projects.id
week_startDATEnoalways a Monday in the team time zone
healthTEXTnoshown as On track, At risk, BlockedCheck: health IN ('on_track', 'at_risk', 'blocked')
noteTEXTnotrimmed, line breaks turned into spaces (R4)Check: length(note) BETWEEN 1 AND 500
posted_byTEXTnoReferences people.idwho saved it last; kept when the owner changes (R11)
posted_atTIMESTAMPnotime of the last save
revisionINTEGERno11 on the first post, plus 1 on each revisionCheck: revision >= 1
  • Unique together: project_id, week_start
  • Index updates_week_idx on (week_start). The board and the report read updates by week.
  • App rule (R1): only the project's current owner posts or revises; admins get no exception.
  • App rule (R2): only the current week, computed on the server in the team time zone, can be posted or revised.
  • App rule (R5): the app never writes health on its own or copies it into a week without an update.

activities

The append-only activity log of a project.

ColumnTypeNullDefaultKeyNotes
idTEXTnoPrimary key
project_idTEXTnoReferences projects.id
actor_idTEXTnoReferences people.id
typeTEXTnoCheck: type IN ('project_created', 'project_edited', 'owner_changed', 'archived', 'restored', 'update_posted', 'update_revised')
dataTEXTyesJSON as text: old and new values, such as from and to owner or old and new health and note
created_atTIMESTAMPnoCURRENT_TIMESTAMP
  • Index activities_project_idx on (project_id, created_at)
  • App rule (R12): every action in section 7 writes its row; rows are never edited or deleted.

notifications

The email outbox: one row per message, written before sending.

ColumnTypeNullDefaultKeyNotes
idTEXTnoPrimary key
kindTEXTnoCheck: kind IN ('reminder', 'report', 'owner_changed')
to_emailTEXTno
person_idTEXTyesReferences people.idempty for report recipients outside the team
week_startDATEyesthe week a reminder or report is for
subjectTEXTno
bodyTEXTnoplain text
statusTEXTno'pending'logged when no email provider is configuredCheck: status IN ('pending', 'sent', 'logged', 'failed')
errorTEXTyesthe last send error, if any
attemptsINTEGERno0each send attempt adds 1; 3 in allCheck: attempts BETWEEN 0 AND 3
created_atTIMESTAMPnoCURRENT_TIMESTAMP
sent_atTIMESTAMPyes
  • Index notifications_failed_idx on (created_at) where status = 'failed'. The hourly job retries failed notifications only.
  • App rule (section 12): a failed send is retried by the hourly job until it has had 3 attempts; a failure never blocks a save.

The SQL

The whole schema in one file. It runs top to bottom, unmodified, on SQLite and PostgreSQL. Download project-status-board.sql or copy it from here.

project-status-board.sql
-- Project Status Board database schema
-- Source: https://personalsoftwarefactory.com/blueprints/project-status-board (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.

-- One row per person on the team.
-- App rule (R10): deactivating someone who owns an active project is refused, and there must always be at least one active admin.
CREATE TABLE people (
  id TEXT PRIMARY KEY,
  name TEXT NOT NULL CHECK (length(name) >= 1),
  email TEXT NOT NULL UNIQUE CHECK (email = lower(email)), -- stored lowercase
  is_admin BOOLEAN NOT NULL DEFAULT FALSE,
  active BOOLEAN NOT NULL DEFAULT TRUE
);

-- The single settings row for the one team and board.
CREATE TABLE settings (
  id INTEGER PRIMARY KEY CHECK (id = 1), -- one row only
  team_name TEXT NOT NULL CHECK (length(team_name) BETWEEN 1 AND 60), -- used in the report title
  time_zone TEXT NOT NULL DEFAULT 'America/New_York', -- IANA name; decides today, weeks and job times
  update_weekday INTEGER NOT NULL DEFAULT 1 CHECK (update_weekday BETWEEN 1 AND 7), -- 1 = Monday to 7 = Sunday
  reminder_time TEXT NOT NULL DEFAULT '09:00' CHECK (reminder_time LIKE '__:__' AND reminder_time BETWEEN '00:00' AND '23:59' AND substr(reminder_time, 4, 2) < '60'), -- HH:MM, 24-hour, team time
  report_time TEXT NOT NULL DEFAULT '15:00' CHECK (report_time LIKE '__:__' AND report_time BETWEEN '00:00' AND '23:59' AND substr(report_time, 4, 2) < '60'), -- HH:MM, 24-hour, team time
  report_recipients TEXT NOT NULL DEFAULT '', -- email addresses separated by commas; empty means the scheduled report is skipped
  last_reminder_week DATE, -- written only by the scheduled job: the Monday of the last week reminded
  last_report_week DATE, -- written only by the scheduled job: the Monday of the last week reported
  CHECK (report_time > reminder_time)
);

-- One row per project on the board. Projects are archived, never deleted.
-- App rule (R9): only the owner or an admin can edit, change the owner, archive or restore.
-- App rule (R10): owner_id must point at an active person.
-- App rule (R7): an archived project is read-only and left out of the board, missing counts, reminders and reports.
CREATE TABLE projects (
  id TEXT PRIMARY KEY,
  name TEXT NOT NULL CHECK (length(name) BETWEEN 1 AND 100), -- trimmed; unique ignoring case across active and archived projects (index below)
  owner_id TEXT NOT NULL REFERENCES people(id),
  target_date DATE NOT NULL, -- may be in the past; the board then shows past target date (R13)
  start_week DATE NOT NULL, -- always a Monday: the week the project was created; never edited
  archived_at TIMESTAMP, -- empty while active
  created_by TEXT NOT NULL REFERENCES people(id),
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- One row per project per week: the owner's health and note for that week. Revising replaces the row's values.
-- App rule (R1): only the project's current owner posts or revises; admins get no exception.
-- App rule (R2): only the current week, computed on the server in the team time zone, can be posted or revised.
-- App rule (R5): the app never writes health on its own or copies it into a week without an update.
CREATE TABLE updates (
  id TEXT PRIMARY KEY,
  project_id TEXT NOT NULL REFERENCES projects(id),
  week_start DATE NOT NULL, -- always a Monday in the team time zone
  health TEXT NOT NULL CHECK (health IN ('on_track', 'at_risk', 'blocked')), -- shown as On track, At risk, Blocked
  note TEXT NOT NULL CHECK (length(note) BETWEEN 1 AND 500), -- trimmed, line breaks turned into spaces (R4)
  posted_by TEXT NOT NULL REFERENCES people(id), -- who saved it last; kept when the owner changes (R11)
  posted_at TIMESTAMP NOT NULL, -- time of the last save
  revision INTEGER NOT NULL DEFAULT 1 CHECK (revision >= 1), -- 1 on the first post, plus 1 on each revision
  UNIQUE (project_id, week_start)
);

-- The append-only activity log of a project.
-- App rule (R12): every action in section 7 writes its row; rows are never edited or deleted.
CREATE TABLE activities (
  id TEXT PRIMARY KEY,
  project_id TEXT NOT NULL REFERENCES projects(id),
  actor_id TEXT NOT NULL REFERENCES people(id),
  type TEXT NOT NULL CHECK (type IN ('project_created', 'project_edited', 'owner_changed', 'archived', 'restored', 'update_posted', 'update_revised')),
  data TEXT, -- JSON as text: old and new values, such as from and to owner or old and new health and note
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- The email outbox: one row per message, written before sending.
-- App rule (section 12): a failed send is retried by the hourly job until it has had 3 attempts; a failure never blocks a save.
CREATE TABLE notifications (
  id TEXT PRIMARY KEY,
  kind TEXT NOT NULL CHECK (kind IN ('reminder', 'report', 'owner_changed')),
  to_email TEXT NOT NULL,
  person_id TEXT REFERENCES people(id), -- empty for report recipients outside the team
  week_start DATE, -- the week a reminder or report is for
  subject TEXT NOT NULL,
  body TEXT NOT NULL, -- plain text
  status TEXT NOT NULL DEFAULT 'pending' CHECK (status IN ('pending', 'sent', 'logged', 'failed')), -- logged when no email provider is configured
  error TEXT, -- the last send error, if any
  attempts INTEGER NOT NULL DEFAULT 0 CHECK (attempts BETWEEN 0 AND 3), -- each send attempt adds 1; 3 in all
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  sent_at TIMESTAMP
);

-- Project names are unique ignoring case (R8).
CREATE UNIQUE INDEX projects_name_idx ON projects (lower(name));

-- The board and the report read updates by week.
CREATE INDEX updates_week_idx ON updates (week_start);
CREATE INDEX projects_owner_idx ON projects (owner_id);
CREATE INDEX activities_project_idx ON activities (project_id, created_at);

-- The hourly job retries failed notifications only.
CREATE INDEX notifications_failed_idx ON notifications (created_at) WHERE status = 'failed';

Seed data

Loads all of section 15: the settings row, 7 people, 4 projects, 13 updates, and the 17 activity rows the spec asks for (one project_created per project, one update_posted per update). Dates are fixed at T = Tue Oct 13, 2026, the day the spec's worked examples use, and the moment of seeding is taken as 10:00 New York time that day. Job titles from the people table have no column and are not loaded; activity data is empty because the spec gives none; the outbox starts empty, as the spec says.

Download project-status-board-seed.sql (42 rows). It loads with foreign keys enforced on both engines.

Load it

SQLite, into a new file:

sqlite3
curl -s https://personalsoftwarefactory.com/schemas/project-status-board.sql https://personalsoftwarefactory.com/schemas/project-status-board-seed.sql | sqlite3 project_status_board.db

PostgreSQL, into a new database:

psql
createdb project_status_board && curl -s https://personalsoftwarefactory.com/schemas/project-status-board.sql https://personalsoftwarefactory.com/schemas/project-status-board-seed.sql | psql -v ON_ERROR_STOP=1 project_status_board

SQLite only enforces foreign keys when the connection asks for it: run PRAGMA foreign_keys = ON; when your app opens the database.

Design decisions

One update per project per week, enforced by a unique key

Rule R3 says one update per project per week, enforced by the database, and that saving again revises it. The unique key on (project_id, week_start) does that, and the revision column counts saves (section 7). Section 14 relies on it: when an owner saves from two tabs at once, the key and an upsert in one transaction leave one row, and the second save counts as a revision.

Missing updates are computed, never stored

Rule R6 defines a missing update as an active project whose start_week is on or before the week and that has no update row for it, and R5 forbids the app from writing or copying a health on its own. So there is no placeholder row and no status column for missing. The board shows No update from the absence of a row, and weeks before start_week are Not started rather than missing.

Weeks are stored as their Monday

Section 6 identifies a week by its Monday in the team time zone, so updates.week_start and projects.start_week are plain dates. Computing that Monday needs a time-zone library, because Sunday 23:30 in New York is already Monday in UTC; the app does it, and the database only stores the result. Checking that a date is a Monday needs engine-specific date functions, so that check is left to the app.

Archiving is a timestamp, not a flag

Section 9 shows an archived project's squares as Archived only for weeks after the week it was archived, and the CSV export runs to that week. A boolean flag would lose when that happened, so projects.archived_at holds the time and is cleared on Restore. Rule R7 then keeps archived projects out of the board, the counts, the reminders and every report.

Notifications count their send attempts

From the build test · field report

Section 12 retries a failed email on the next run of the job, up to 3 attempts in all, and the attempts column, checked to stay between 0 and 3, carries that. The build test found that failed emails were retried forever, with nothing counting the attempts (gap 5); the spec now counts attempts and stops after 3.

The report time must be later than the reminder time

Section 5 refuses a report_time that is not later than reminder_time. Both are stored as zero-padded HH:MM text, so a plain text comparison orders them correctly and the rule fits in one table check. The settings table has a single row, pinned by a primary key that can only be 1.

Example queries

The queries behind the tool's main screens. Each returned the same rows on both engines against the seed data.

The board grid: four weeks of health per project

SQL
SELECT p.name, o.name AS owner, p.target_date, CASE WHEN p.start_week > '2026-09-21' THEN 'Not started' ELSE COALESCE((SELECT u.health FROM updates u WHERE u.project_id = p.id AND u.week_start = '2026-09-21'), 'No update') END AS week_sep_21, CASE WHEN p.start_week > '2026-09-28' THEN 'Not started' ELSE COALESCE((SELECT u.health FROM updates u WHERE u.project_id = p.id AND u.week_start = '2026-09-28'), 'No update') END AS week_sep_28, CASE WHEN p.start_week > '2026-10-05' THEN 'Not started' ELSE COALESCE((SELECT u.health FROM updates u WHERE u.project_id = p.id AND u.week_start = '2026-10-05'), 'No update') END AS week_oct_5, CASE WHEN p.start_week > '2026-10-12' THEN 'Not started' ELSE COALESCE((SELECT u.health FROM updates u WHERE u.project_id = p.id AND u.week_start = '2026-10-12'), 'No update') END AS week_oct_12 FROM projects p JOIN people o ON o.id = p.owner_id WHERE p.archived_at IS NULL ORDER BY p.name;

On the seed data: 4 rows, the worked example in section 9. CRM migration reads on_track, on_track, on_track, blocked; Hiring plan has No update for Sep 28 and Oct 12; Q4 pricing is Not started on Sep 21.

Board header: projects updated out of projects expected

SQL
SELECT COUNT(u.id) AS updated, COUNT(*) AS expected FROM projects p LEFT JOIN updates u ON u.project_id = p.id AND u.week_start = '2026-10-12' WHERE p.archived_at IS NULL AND p.start_week <= '2026-10-12';

On the seed data for the week of Oct 12, 2026: 1 row, 3 updated of 4 expected ("3 of 4 projects updated").

Missing updates panel

SQL
SELECT p.name, o.name AS owner FROM projects p JOIN people o ON o.id = p.owner_id WHERE p.archived_at IS NULL AND p.start_week <= '2026-10-12' AND NOT EXISTS (SELECT 1 FROM updates u WHERE u.project_id = p.id AND u.week_start = '2026-10-12') ORDER BY p.name;

On the seed data for the week of Oct 12, 2026: 1 row, Hiring plan (Maya Chen).

Weekly report lines in report order

SQL
SELECT COALESCE(u.health, 'no_update') AS report_group, p.name, o.name AS owner, p.target_date, u.note, CASE WHEN prev.health IS NOT NULL AND prev.health <> u.health THEN prev.health END AS was_last_week FROM projects p JOIN people o ON o.id = p.owner_id LEFT JOIN updates u ON u.project_id = p.id AND u.week_start = '2026-10-12' LEFT JOIN updates prev ON prev.project_id = p.id AND prev.week_start = '2026-10-05' WHERE p.archived_at IS NULL AND p.start_week <= '2026-10-12' ORDER BY CASE COALESCE(u.health, 'no_update') WHEN 'blocked' THEN 1 WHEN 'at_risk' THEN 2 WHEN 'on_track' THEN 3 ELSE 4 END, p.target_date, p.name;

On the seed data for the week of Oct 12, 2026: 4 rows in the order of the section 10 example. CRM migration is first (blocked, was on_track last week), then Q4 pricing, Website relaunch, and Hiring plan with no update.

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 Project Status Board blueprint, a free spec that also has the business rules, the screens, 4 phased build prompts and 28 acceptance checks for building the whole tool with an AI app builder. We built it from those prompts and the result passed 28 of 28 acceptance checks in a browser.

Follow new blueprints

Every new blueprint and build test appears in the feed and in the public GitHub repository. No account, no email list.