Tables in this data model
- plans — 5 columns
- accounts — 4 columns
- subscriptions — 5 columns
- profiles — 4 columns
- titles — 5 columns
- episodes — 5 columns
- watch_history — 6 columns
- watchlist_items — 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 DBML below and paste it in through ☰ → Import diagram; the finished model exports to SQL DDL or back to DBML.
- Export to PNG, SVG or PDF, or press Ctrl+L for a link that carries the whole diagram.
DBML 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.
Table plans {
id integer [pk]
name varchar
max_streams integer
max_resolution varchar
monthly_price decimal
}
Table accounts {
id integer [pk]
email varchar [unique]
country char
created_at timestamp
}
Table subscriptions {
id integer [pk]
account_id integer [ref: > accounts.id]
plan_id integer [ref: > plans.id]
status varchar
renews_on date
}
Table profiles {
id integer [pk]
account_id integer [ref: > accounts.id]
name varchar
is_kids boolean
}
Table titles {
id integer [pk]
name varchar
type varchar
maturity_rating varchar
release_year integer
}
Table episodes {
id integer [pk]
title_id integer [ref: > titles.id]
season integer
number integer
duration_minutes integer
}
Table watch_history {
id integer [pk]
profile_id integer [ref: > profiles.id]
title_id integer [ref: > titles.id]
episode_id integer [ref: > episodes.id]
position_seconds integer
watched_at timestamp
}
Table watchlist_items {
id integer [pk]
profile_id integer [ref: > profiles.id]
title_id integer [ref: > titles.id]
added_at timestamp
}
Related: Database schema diagram tool · All database & er models templates · All 521 templates