Skip to content

app.attachment_versions

TableRow level security on

One stored file per attachment version: its object in the attachments bucket, type, size, checksum and virus-scan state. Versions are never replaced; a new file is a new version.

Primary key: id

Columns of app.attachment_versions
ColumnTypeNullableDescription
iduuidNoPrimary key, UUID v7.
org_iduuidNoOwning org, derived from app.attachments on insert; never accepted from the caller and never changed.References app.organizations.id
attachment_iduuidNoAttachment.References app.attachments.id
version_numberintegerNoVersion within the attachment, issued by the database.
object_nametextNoObject name in the attachments bucket: <org_id>/<attachment_id>/<version_id>/<file name>, issued by the database.
filenametextNoFile name as uploaded.
content_typetextNoMIME type, one the bucket allows.
size_bytesbigintNoSize in bytes, at most 50 MiB.
checksum_sha256textYesSHA-256 of the stored file, set when the upload completes.
uploaded_byuuidYesPerson who uploaded the version, set from the session.References app.people.id
uploaded_attimestamp with time zoneYesWhen the upload completed.
scan_statusapp.scan_statusNoPending Upload, Scanning, Clean, Infected or Scan Failed.
scanned_attimestamp with time zoneYesWhen the scanner reported.
scan_detailtextYesScanner finding, for an infected or failed scan.
document_version_iduuidYesDocument version this file became, for an attachment on a document.References app.document_versions.id
created_attimestamp with time zoneNoWhen the row was inserted. Set by the database.
created_byuuidYesPerson who inserted the row, or null for a platform process. Set by the database.References app.people.id
updated_attimestamp with time zoneNoWhen the row last changed. Set by the database.
updated_byuuidYesPerson who last changed the row, or null for a platform process. Set by the database.References app.people.id
deleted_attimestamp with time zoneYesSoft delete time. A row with deleted_at set is ignored by every access helper.