- Added MongoDB chat/message integration for seller responses - Improved seller response validation and default messaging - Integrated automatic chat creation/update when responding to intentions - Added highest custom offer fields to listing queries and models - Enhanced listing data with top offer information for buyers
18 lines
643 B
SQL
18 lines
643 B
SQL
-- 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;
|
|
|