Files
accounted/supabase/migrations/20260225100248_supplier_invoice_transaction_match.sql
Jakob Wennberg b0de46790a fix: align local migrations with deployed Supabase state
Rename migration files (039-052) from sequential to real deployed
timestamps, add 11 missing migration files that were applied directly
to production, apply invoice_delivery_note_sequences migration, and
rename placeholder files for clarity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-06 10:16:22 +01:00

11 lines
510 B
SQL

-- Migration: supplier_invoice_transaction_match
-- Adds potential_supplier_invoice_id to transactions for supplier invoice matching.
-- Note: supplier_invoice_id on transactions is already added by migration 025 (payroll).
ALTER TABLE public.transactions
ADD COLUMN IF NOT EXISTS potential_supplier_invoice_id UUID
REFERENCES public.supplier_invoices(id) ON DELETE SET NULL;
CREATE INDEX IF NOT EXISTS idx_transactions_potential_supplier_invoice
ON public.transactions(potential_supplier_invoice_id);