-- Session slide manager table
CREATE TABLE IF NOT EXISTS workshop_session_slides (
  workshop_session_slide_id BIGINT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  workshop_session_id BIGINT NOT NULL,
  slide_title VARCHAR(255) NOT NULL,
  slide_notes TEXT NULL,
  image_url VARCHAR(512) NOT NULL,
  image_path VARCHAR(1024) NOT NULL,
  sort_order INT NOT NULL DEFAULT 0,
  created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  INDEX idx_session_slides_session (workshop_session_id),
  INDEX idx_session_slides_sort (workshop_session_id, sort_order, workshop_session_slide_id)
);

-- Optional foreign key when workshop_sessions uses InnoDB and matching collation.
-- ALTER TABLE workshop_session_slides
--   ADD CONSTRAINT fk_session_slides_session
--   FOREIGN KEY (workshop_session_id)
--   REFERENCES workshop_sessions(workshop_session_id)
--   ON DELETE CASCADE;
