-- Add location columns to proxies table
ALTER TABLE proxies
ADD COLUMN IF NOT EXISTS city VARCHAR(100),
ADD COLUMN IF NOT EXISTS state VARCHAR(100),
ADD COLUMN IF NOT EXISTS country VARCHAR(100),
ADD COLUMN IF NOT EXISTS country_code VARCHAR(2),
ADD COLUMN IF NOT EXISTS location_updated_at TIMESTAMP;

-- Add index for location-based queries
CREATE INDEX IF NOT EXISTS idx_proxies_location ON proxies(country_code, state, city);

-- Add the same to failed_proxies table
ALTER TABLE failed_proxies
ADD COLUMN IF NOT EXISTS city VARCHAR(100),
ADD COLUMN IF NOT EXISTS state VARCHAR(100),
ADD COLUMN IF NOT EXISTS country VARCHAR(100),
ADD COLUMN IF NOT EXISTS country_code VARCHAR(2),
ADD COLUMN IF NOT EXISTS location_updated_at TIMESTAMP;
