-- Migration 020: Custom offer fields for purchase intentions -- Criado em: 2025-02-07 ALTER TABLE purchase_intentions ADD COLUMN IF NOT EXISTS custom_offer_amount NUMERIC(12, 2), ADD COLUMN IF NOT EXISTS custom_offer_currency VARCHAR(20), ADD COLUMN IF NOT EXISTS custom_offer_created_at TIMESTAMP WITHOUT TIME ZONE; -- Atualizar registros existentes para evitar valores inconsistentes UPDATE purchase_intentions SET custom_offer_amount = NULL, custom_offer_currency = NULL, custom_offer_created_at = NULL WHERE custom_offer_amount IS NOT NULL OR custom_offer_currency IS NOT NULL OR custom_offer_created_at IS NOT NULL;