-- Retour arrière Event'Go 2.0.0.
-- Les domaines normalisés à eventgo restent compatibles avec toutes les versions.

SET @index_exists := (
  SELECT COUNT(*) FROM information_schema.statistics
  WHERE table_schema = DATABASE()
    AND table_name = 'events'
    AND index_name = 'idx_events_public_domain_date'
);
SET @sql := IF(
  @index_exists > 0,
  'DROP INDEX idx_events_public_domain_date ON events',
  'SELECT 1'
);
PREPARE eventgo_stmt FROM @sql;
EXECUTE eventgo_stmt;
DEALLOCATE PREPARE eventgo_stmt;
