ALTER TABLE slots
  ADD COLUMN date_type VARCHAR(10) NOT NULL DEFAULT 'single' AFTER role_name,
  ADD COLUMN slot_date DATE NULL AFTER date_type,
  ADD COLUMN slot_start_date DATE NULL AFTER slot_date,
  ADD COLUMN slot_end_date DATE NULL AFTER slot_start_date,
  ADD COLUMN start_time TIME NULL AFTER slot_end_date,
  ADD COLUMN end_time TIME NULL AFTER start_time;

UPDATE slots
SET
  date_type = 'single',
  slot_date = DATE(start_at),
  slot_start_date = DATE(start_at),
  slot_end_date = NULL,
  start_time = TIME(start_at),
  end_time = TIME(end_at)
WHERE slot_start_date IS NULL;

ALTER TABLE slots
  MODIFY COLUMN start_time TIME NOT NULL,
  MODIFY COLUMN end_time TIME NOT NULL;

CREATE INDEX idx_slots_event_start_date_time ON slots(event_id, slot_start_date, start_time);
