app.attachment_versions
TablaSeguridad a nivel de fila activa
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.
Clave primaria: id
| Columna | Tipo | Admite nulos | Descripción |
|---|---|---|---|
| id | uuid | No | Primary key, UUID v7. |
| org_id | uuid | No | Owning org, derived from app.attachments on insert; never accepted from the caller and never changed.Hace referencia a app.organizations.id |
| attachment_id | uuid | No | Attachment.Hace referencia a app.attachments.id |
| version_number | integer | No | Version within the attachment, issued by the database. |
| object_name | text | No | Object name in the attachments bucket: <org_id>/<attachment_id>/<version_id>/<file name>, issued by the database. |
| filename | text | No | File name as uploaded. |
| content_type | text | No | MIME type, one the bucket allows. |
| size_bytes | bigint | No | Size in bytes, at most 50 MiB. |
| checksum_sha256 | text | Sí | SHA-256 of the stored file, set when the upload completes. |
| uploaded_by | uuid | Sí | Person who uploaded the version, set from the session.Hace referencia a app.people.id |
| uploaded_at | timestamp with time zone | Sí | When the upload completed. |
| scan_status | app.scan_status | No | Pending Upload, Scanning, Clean, Infected or Scan Failed. |
| scanned_at | timestamp with time zone | Sí | When the scanner reported. |
| scan_detail | text | Sí | Scanner finding, for an infected or failed scan. |
| document_version_id | uuid | Sí | Document version this file became, for an attachment on a document.Hace referencia a app.document_versions.id |
| created_at | timestamp with time zone | No | When the row was inserted. Set by the database. |
| created_by | uuid | Sí | Person who inserted the row, or null for a platform process. Set by the database.Hace referencia a app.people.id |
| updated_at | timestamp with time zone | No | When the row last changed. Set by the database. |
| updated_by | uuid | Sí | Person who last changed the row, or null for a platform process. Set by the database.Hace referencia a app.people.id |
| deleted_at | timestamp with time zone | Sí | Soft delete time. A row with deleted_at set is ignored by every access helper. |