ALTER TABLE partners ADD COLUMN IF NOT EXISTS last_validated_by VARCHAR(150) DEFAULT NULL AFTER asaas_payment_id;
ALTER TABLE partners ADD COLUMN IF NOT EXISTS last_validated_at DATETIME DEFAULT NULL AFTER last_validated_by;
CREATE TABLE IF NOT EXISTS gallery_images (
  id INT AUTO_INCREMENT PRIMARY KEY,
  image_url TEXT NOT NULL,
  source_type ENUM('instagram','upload') NOT NULL DEFAULT 'upload',
  title VARCHAR(180) DEFAULT NULL,
  display_order INT NOT NULL DEFAULT 0,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
INSERT INTO gallery_images (id, image_url, source_type, title, display_order) VALUES
  (1, 'https://images.unsplash.com/photo-1540039155733-5bb30b53aa14?auto=format&fit=crop&q=80', 'instagram', 'Pista cheia', 0),
  (2, 'https://images.unsplash.com/photo-1514525253361-bee8718a74a2?auto=format&fit=crop&q=80', 'instagram', 'Show ao vivo', 1),
  (3, 'https://images.unsplash.com/photo-1459749411177-042180ce673c?auto=format&fit=crop&q=80', 'instagram', 'Galera no clima', 2),
  (4, 'https://images.unsplash.com/photo-1516450360452-9312f5e86fc7?auto=format&fit=crop&q=80', 'upload', 'Nossa Vibe 1', 0),
  (5, 'https://images.unsplash.com/photo-1470225620780-dba8ba36b745?auto=format&fit=crop&q=80', 'upload', 'Nossa Vibe 2', 1)
ON DUPLICATE KEY UPDATE image_url = VALUES(image_url), source_type = VALUES(source_type), title = VALUES(title), display_order = VALUES(display_order);
