ALTER TABLE domains ADD COLUMN IF NOT EXISTS expires_at TIMESTAMPTZ, ADD COLUMN IF NOT EXISTS is_active BOOLEAN NOT NULL DEFAULT TRUE; CREATE INDEX IF NOT EXISTS idx_domains_is_active ON domains (is_active); UPDATE domains SET expires_at = NOW() + INTERVAL '365 days' WHERE expires_at IS NULL;