veza/veza-backend-api/migrations/108_gear_images.sql
senke 89cc015e54 feat(v0.501): Sprint 1 -- infrastructure foundations
- Add MinIO S3-compatible storage to docker-compose (dev, staging, prod)
- Create migrations 103-108 (waveform_url, user_folders, user_files,
  user_storage_quotas, gear_items.is_public, gear_images)
- Add Go models: UserFile, UserFolder, StorageQuota, GearImage
- Add WaveformURL to Track model, IsPublic + GearImages to GearItem model
2026-02-22 18:10:25 +01:00

10 lines
414 B
SQL

-- Migration 108: Create gear_images table (v0.501 G1.2)
CREATE TABLE IF NOT EXISTS gear_images (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
gear_id UUID NOT NULL REFERENCES gear_items(id) ON DELETE CASCADE,
image_url VARCHAR(500) NOT NULL,
position INT NOT NULL DEFAULT 0,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
CREATE INDEX idx_gear_images_gear_id ON gear_images(gear_id);