app.doc_snapshots
TableRow level security on
One live co-edited document per row and field (Section 5, Section 7.3): the merged Yjs state, the update sequence it covers and a plain text projection. Readable by whoever can read the row it belongs to; written only through app.open_doc, app.append_doc_update and app.compact_doc.
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 |
| subject_table | text | No | Table of the row the document belongs to.References private.coedit_subjects.table_name |
| subject_id | uuid | No | Row the document belongs to. |
| doc_key | text | No | Which document of the row, for example body.References private.coedit_subjects.doc_key |
| generation | integer | No | Raised when the document is reseeded from its row after the row's text changed outside the editor; updates of an older generation are refused. |
| state | bytea | Yes | Merged Yjs state (an encoded update) covering every update up to through_seq; NULL before the first compaction. |
| through_seq | bigint | No | Highest update sequence folded into state. |
| last_seq | bigint | No | Highest update sequence issued for the document. |
| text_snapshot | text | Yes | Plain text of the document at the last compaction, or the row's text it was seeded from. |
| base_updated_at | timestamp with time zone | Yes | The row's updated_at when the editor last wrote its text into the row or seeded from it. |
| deleted_at | timestamp with time zone | Yes | Soft delete time. A row with deleted_at set is ignored by every access helper. |
| 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 |