Files
xevion.dev/migrations/20260115031618_add_project_media.sql
Xevion e83133cfcc 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
2026-01-14 22:34:15 -06:00

25 lines
760 B
SQL

-- 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);