post_views table
The post_views table in the Blog Database Schema schema has 6 columns, keyed by id, with 1 foreign key to posts.
Pre-aggregated per post per day per referrer, not one row per hit. Raw hit logs belong in an analytics pipeline, not the blog database.
Columns (6)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| post_id | uuid | not null, references posts.id | |
| viewed_on | date | not null | |
| view_count | integer | not null | |
| unique_count | integer | not null | |
| referrer_host | varchar(255) |
Indexes (2)
(post_id, viewed_on, referrer_host)unique(viewed_on)
Relationships
post_views.post_idreferencesposts.id