mirror of
https://github.com/renee-png/acmcc.git
synced 2026-06-21 09:50:01 +00:00
183fe0a93c
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
21 lines
727 B
SQL
21 lines
727 B
SQL
-- Erase legacy QBO sync data so it doesn't conflict with the active Zoho integration
|
|
|
|
-- Clear QBO references on company bank transactions
|
|
UPDATE public.company_bank_transactions
|
|
SET qbo_id = NULL,
|
|
qbo_sync_status = NULL
|
|
WHERE qbo_id IS NOT NULL OR qbo_sync_status IS NOT NULL;
|
|
|
|
-- Clear QBO references on client invoices (no rows currently, but reset for safety)
|
|
UPDATE public.client_invoices
|
|
SET qbo_invoice_id = NULL,
|
|
qbo_sync_status = 'not_synced',
|
|
qbo_synced_at = NULL,
|
|
qbo_sync_error = NULL
|
|
WHERE qbo_invoice_id IS NOT NULL
|
|
OR qbo_sync_status NOT IN ('not_synced')
|
|
OR qbo_synced_at IS NOT NULL
|
|
OR qbo_sync_error IS NOT NULL;
|
|
|
|
-- Wipe the QBO sync log entirely
|
|
TRUNCATE TABLE public.qbo_sync_log; |