Files
cannaiq/backend/migrations/009_image_sizes.sql
2025-11-28 19:45:44 -07:00

12 lines
401 B
SQL

-- Add columns for multiple image sizes
ALTER TABLE products
ADD COLUMN IF NOT EXISTS thumbnail_path TEXT,
ADD COLUMN IF NOT EXISTS medium_path TEXT;
-- Rename local_image_path to full_path for clarity
ALTER TABLE products
RENAME COLUMN local_image_path TO full_path;
-- Add index for image queries
CREATE INDEX IF NOT EXISTS idx_products_images ON products(full_path, thumbnail_path, medium_path);