ALTER TABLE events
  ADD COLUMN date_type VARCHAR(10) NOT NULL DEFAULT 'single' AFTER title,
  ADD COLUMN event_start_date DATE NULL AFTER event_date,
  ADD COLUMN event_end_date DATE NULL AFTER event_start_date,
  ADD COLUMN backup_date1 DATE NULL AFTER event_end_date,
  ADD COLUMN backup_date2 DATE NULL AFTER backup_date1;

UPDATE events
SET
  date_type = 'single',
  event_start_date = event_date
WHERE event_start_date IS NULL;

CREATE INDEX idx_events_school_start_date ON events(school_id, event_start_date);
