mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 04:26:43 -06:00
feat: add media upload pipeline with multipart support, blurhash generation, and R2 storage
- Add project_media table with image/video variants, ordering, and metadata - Implement multipart upload handlers with 50MB limit - Generate blurhash placeholders and resize images to thumb/medium/full variants - Update ProjectCard to use media carousel instead of mock gradients - Add MediaManager component for drag-drop upload and reordering
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
-- Project media table for carousel support
|
||||
-- Each project can have multiple images/videos with ordering
|
||||
|
||||
CREATE TYPE media_type AS ENUM ('image', 'video');
|
||||
|
||||
CREATE TABLE project_media (
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
project_id UUID NOT NULL REFERENCES projects(id) ON DELETE CASCADE,
|
||||
display_order INT NOT NULL DEFAULT 0,
|
||||
media_type media_type NOT NULL,
|
||||
original_filename TEXT NOT NULL,
|
||||
r2_base_path TEXT NOT NULL,
|
||||
variants JSONB NOT NULL,
|
||||
width INT,
|
||||
height INT,
|
||||
size_bytes BIGINT NOT NULL,
|
||||
blurhash TEXT,
|
||||
metadata JSONB,
|
||||
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
|
||||
|
||||
UNIQUE (project_id, display_order)
|
||||
);
|
||||
|
||||
CREATE INDEX idx_project_media_project_id ON project_media(project_id);
|
||||
Reference in New Issue
Block a user