-- Migration 012 — Coordenadas em agenda_events
-- Bloco: Hotfix Geo Territorial
-- Adiciona latitude e longitude para posicionamento preciso no mapa.
-- Idempotente via IF NOT EXISTS (MySQL 8+ / MariaDB 10.3+).

ALTER TABLE agenda_events
  ADD COLUMN IF NOT EXISTS latitude  DECIMAL(10,8) NULL AFTER location,
  ADD COLUMN IF NOT EXISTS longitude DECIMAL(11,8) NULL AFTER latitude;

-- Índice para queries geoespaciais do MapController
ALTER TABLE agenda_events
  ADD INDEX IF NOT EXISTS idx_agenda_geo (latitude, longitude);
