T-HUB/apps/api/migrations/041_archive_storage_key.sql
glass beadian 18afff5e49 feat: Files payloads move from oCIS WebDAV to R2 object storage
The Files tab was the only payload path not on object storage, violating the
2026-10-06 directive (object storage is the ONLY media I/O path) — and oCIS's
WebDAV surface is currently 500ing server-side, which made every upload fail.

Uploads now seal + dedupe into R2 via StorageService (SPENC1, content-
addressed); downloads read R2 when storage_key is set, falling back to oCIS
for legacy rows. Share-into-library copies oCIS Drive sources into R2 and
records the real sha256 instead of a placeholder. Migration 041 adds
chat_media_archive.storage_key.
2026-10-15 22:11:07 +00:00

4 lines
295 B
SQL

-- Files uploads move to R2 object storage (SPENC1-sealed, content-addressed),
-- matching the user directive that object storage is the only media path.
-- Legacy rows keep their oCIS resource ids; storage_key is read first when set.
ALTER TABLE chat_media_archive ADD COLUMN storage_key text;