Feature #10392
openS3 media storage restructure
100%
Description
Migrated all menu images from external hot-linked URLs (Google/Bing thumbnails, YouTube, Pinterest, recipe blogs) onto our own S3 bucket — these were third-party links that expire without warning and were already causing broken images for customers.
Designed and implemented a tenant-first folder structure: tenants/<restaurant>/<module>/…, so each restaurant's media sits under a single prefix. This makes per-tenant access policies, storage/cost reporting, lifecycle rules, and offboarding deletes possible — none of which worked with the previous flat layout.
Separated file types by module: menu images, gallery, category images, homepage PDFs, asset documents, purchase-order attachments, support attachments, etc. Documents are kept apart from images so archival rules can target one without touching the other.
Added platform-level storage (platform/…) for superadmin records — material providers and superadmin profiles are shared across all restaurants, so filing them under one tenant would have meant offboarding that restaurant deletes files others still use.
Updated the upload endpoint so all new uploads land in the correct folder automatically. New restaurants need no setup — the folder derives from the tenant at upload time.
Handled the public-upload cases: registration logos (uploaded before a restaurant exists) and customer-facing catering attachments now route correctly instead of falling into a shared bucket.
Wrote a reusable migration script plus a backup/restore script; every migration run was backed up beforehand and is fully reversible.
Subtasks
Related issues