Data model
The sypnia_files schema: buckets, objects, uploads in progress, S3 keys and the functions policies use.
| Table | Holds |
|---|---|
sypnia_files.buckets | id, public, max_file_size, allowed_types, scan, cache_control, storage (the backend and prefix), created_at |
sypnia_files.objects | id, bucket_id, name, owner, size, content_type, checksum, scan_status (not_scanned, pending, clean, infected), metadata, case (the use case that last wrote it), timestamps; unique on (bucket_id, name); row-level security on |
sypnia_files.uploads | resumable uploads in progress: id, bucket_id, name, owner, offset, size, expires_at, the storage upload id |
sypnia_files.s3_keys | id, secret_hash, buckets, actions, created_by, last_used_at |
sypnia_files.audit | key and admin actions |
Functions: sypnia_files.foldername(text) returns text[], filename(text), extension(text). The schema is installed by the engine’s migrations (sypnia-files install) and never edited by hand.
In storage, an object lives at <project>/<bucket>/<object id>, not at its path: moving a file only updates its row.