-- Geolocation columns (idempotent)
ALTER TABLE products
  ADD COLUMN IF NOT EXISTS lat DECIMAL(10,7) NULL AFTER city,
  ADD COLUMN IF NOT EXISTS lng DECIMAL(10,7) NULL AFTER lat,
  ADD COLUMN IF NOT EXISTS neighborhood VARCHAR(120) NULL AFTER lng;
ALTER TABLE products ADD INDEX IF NOT EXISTS idx_products_geo (lat, lng);
ALTER TABLE products ADD INDEX IF NOT EXISTS idx_products_neigh (neighborhood);
ALTER TABLE users
  ADD COLUMN IF NOT EXISTS lat DECIMAL(10,7) NULL,
  ADD COLUMN IF NOT EXISTS lng DECIMAL(10,7) NULL,
  ADD COLUMN IF NOT EXISTS neighborhood VARCHAR(120) NULL;
