-- Migration 005: Add last_checked column to domains table
-- Enables cache expiration for DNS verification (separate from user authentication)
-- See ADR-010 for the domain verification vs user authentication distinction

-- Add last_checked column for DNS verification cache expiration
ALTER TABLE domains ADD COLUMN last_checked TIMESTAMP;

-- Update existing verified domains to set last_checked = verified_at
UPDATE domains SET last_checked = verified_at WHERE verified = 1;

-- Record this migration
INSERT INTO migrations (version, description) VALUES (5, 'Add last_checked column to domains table for DNS verification cache');
