/ db / migrations / 007-add-location-columns.sql
007-add-location-columns.sql
 1  -- Migration: Add city and country_code to sites table
 2  -- Date: 2026-01-27
 3  -- Purpose: Store location data for timezone detection and TCPA compliance
 4  
 5  -- Add city column
 6  ALTER TABLE sites ADD COLUMN city TEXT;
 7  
 8  -- Add country_code column (ISO 3166-1 alpha-2)
 9  ALTER TABLE sites ADD COLUMN country_code TEXT;
10  
11  -- Create index for country lookups
12  CREATE INDEX IF NOT EXISTS idx_sites_country ON sites(country_code);