Tables in this data model
- workspaces — 2 columns
- users — 4 columns
- projects — 5 columns
- sprints — 5 columns
- tasks — 8 columns
- labels — 2 columns
- task_labels — 2 columns
- comments — 5 columns
- worklogs — 4 columns
How to use this ER diagram template
- Click Open in the editor. The ER diagram opens on a new page in FlowDiagram — nothing is uploaded and there is no sign-up.
- Rename, add or delete shapes and drag them where you want; connectors stay attached as things move.
- Drop in vendor logos from the library — 1,160 of them, including every AWS, Azure and Google Cloud service icon — or restyle it with the colour and theme controls.
- Prefer text? Edit the SQL DDL below and paste it in through ☰ → Import / export SQL; the finished model exports back to DDL.
- Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.
SQL DDL source
The whole template is the text below. Paste it into FlowDiagram, keep it in Git next to the code it describes, or hand it to an AI assistant to extend.
CREATE TABLE workspaces (
workspace_id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(120) NOT NULL
);
CREATE TABLE users (
user_id INTEGER NOT NULL PRIMARY KEY,
workspace_id INTEGER NOT NULL REFERENCES workspaces(workspace_id),
name VARCHAR(120) NOT NULL,
email VARCHAR(255) NOT NULL
);
CREATE TABLE projects (
project_id INTEGER NOT NULL PRIMARY KEY,
workspace_id INTEGER NOT NULL REFERENCES workspaces(workspace_id),
lead_id INTEGER REFERENCES users(user_id),
name VARCHAR(150) NOT NULL,
key_prefix VARCHAR(10) NOT NULL
);
CREATE TABLE sprints (
sprint_id INTEGER NOT NULL PRIMARY KEY,
project_id INTEGER NOT NULL REFERENCES projects(project_id),
name VARCHAR(60) NOT NULL,
starts_on DATE,
ends_on DATE
);
CREATE TABLE tasks (
task_id INTEGER NOT NULL PRIMARY KEY,
project_id INTEGER NOT NULL REFERENCES projects(project_id),
sprint_id INTEGER REFERENCES sprints(sprint_id),
parent_id INTEGER REFERENCES tasks(task_id),
assignee_id INTEGER REFERENCES users(user_id),
title VARCHAR(250) NOT NULL,
status VARCHAR(20) NOT NULL,
story_points INTEGER
);
CREATE TABLE labels (
label_id INTEGER NOT NULL PRIMARY KEY,
name VARCHAR(40) NOT NULL
);
CREATE TABLE task_labels (
task_id INTEGER NOT NULL REFERENCES tasks(task_id),
label_id INTEGER NOT NULL REFERENCES labels(label_id)
);
CREATE TABLE comments (
comment_id INTEGER NOT NULL PRIMARY KEY,
task_id INTEGER NOT NULL REFERENCES tasks(task_id),
author_id INTEGER NOT NULL REFERENCES users(user_id),
body TEXT NOT NULL,
created_at TIMESTAMP NOT NULL
);
CREATE TABLE worklogs (
worklog_id INTEGER NOT NULL PRIMARY KEY,
task_id INTEGER NOT NULL REFERENCES tasks(task_id),
user_id INTEGER NOT NULL REFERENCES users(user_id),
hours DECIMAL(5,2) NOT NULL
);
Related: Database schema diagram tool · ER diagram from SQL · All database & er models templates · All 521 templates