mirror of
https://github.com/Xevion/xevion.dev.git
synced 2026-01-31 06:26:44 -06:00
- 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
25 lines
760 B
SQL
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);
|