-- =====================================================
-- Migration 003: Add alias field to chats
-- =====================================================
-- Allows users to assign custom names (aliases) to chats
-- Alias takes priority over automatic names from WhatsApp
-- =====================================================

-- Add alias column to chats table
ALTER TABLE chats ADD COLUMN IF NOT EXISTS alias VARCHAR(255);

-- Add index for alias searches (partial index for non-null values)
CREATE INDEX IF NOT EXISTS idx_chats_alias ON chats(alias) WHERE alias IS NOT NULL;
