-- Ürün detay galerisi: virgülle ayrılmış panel yükleme yolları (/api/uploads/…).
-- Kapak görseli `image` sütununda kalır (liste kartları); idempotent.

SET @col_exists := (
  SELECT COUNT(*) FROM information_schema.COLUMNS
  WHERE TABLE_SCHEMA = DATABASE()
    AND TABLE_NAME = 'products'
    AND COLUMN_NAME = 'images'
);

SET @ddl := IF(
  @col_exists = 0,
  'ALTER TABLE products ADD COLUMN images VARCHAR(4096) NULL DEFAULT NULL AFTER image',
  'SELECT 1'
);

PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
