app.recent_views
TableRow level security on
What a person opened (Section 11.7: the last 50 records each person viewed appear before they type): each record, incident, document, SOP or handbook article once, with when they last opened it. At most 50 per person and org; rows go after 90 days and when the person is deleted. Only the person reads or writes their own rows.
Primary key: id
| Column | Type | Nullable | Description |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org. A row never moves to another org.References app.organizations.id |
| person_id | uuid | No | Person who opened it; always the signed-in person.References app.people.id |
| subject_table | text | No | Table of what was opened: records, incidents, documents, sops or handbook_articles. |
| subject_id | uuid | No | Row that was opened. |
| viewed_at | timestamp with time zone | No | When the person last opened it, set by the database. |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Yes | Person who inserted the row, or null for a platform process. Set by the database.References app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Yes | Person who last changed the row, or null for a platform process. Set by the database.References app.people.id |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |