-- Mark wall outlets and their related patch/switch ports as WAN connections. ALTER TABLE locations_wall_outlets ADD COLUMN IF NOT EXISTS is_wan BOOLEAN NOT NULL DEFAULT FALSE; CREATE INDEX IF NOT EXISTS idx_wall_outlets_is_wan ON locations_wall_outlets(is_wan) WHERE deleted_at IS NULL AND is_wan = TRUE;