-- Migration 067c: Add website_type column to company_websites
-- Date: 2026-02-17

ALTER TABLE company_websites ADD COLUMN IF NOT EXISTS website_type VARCHAR(20) DEFAULT 'website';

-- Auto-detect store type from URL patterns
UPDATE company_websites
SET website_type = 'store'
WHERE website_type = 'website'
  AND (url ILIKE '%sklep%' OR url ILIKE '%shop%' OR url ILIKE '%store%' OR url ILIKE '%hurt%');
