diff --git a/src/integrations/supabase/types.ts b/src/integrations/supabase/types.ts index b04d819..98bc041 100644 --- a/src/integrations/supabase/types.ts +++ b/src/integrations/supabase/types.ts @@ -3383,6 +3383,7 @@ export type Database = { created_by: string | null entry_date: string entry_type: string + external_id: string | null id: string note: string | null source_invoice_id: string | null @@ -3399,6 +3400,7 @@ export type Database = { created_by?: string | null entry_date?: string entry_type: string + external_id?: string | null id?: string note?: string | null source_invoice_id?: string | null @@ -3415,6 +3417,7 @@ export type Database = { created_by?: string | null entry_date?: string entry_type?: string + external_id?: string | null id?: string note?: string | null source_invoice_id?: string | null diff --git a/supabase/migrations/20260501144357_f8aab03b-40b5-4f2d-b19e-cc8a58ad71f6.sql b/supabase/migrations/20260501144357_f8aab03b-40b5-4f2d-b19e-cc8a58ad71f6.sql new file mode 100644 index 0000000..73a0d05 --- /dev/null +++ b/supabase/migrations/20260501144357_f8aab03b-40b5-4f2d-b19e-cc8a58ad71f6.sql @@ -0,0 +1,3 @@ +ALTER TABLE public.trust_ledger_entries ADD COLUMN IF NOT EXISTS external_id text; +CREATE UNIQUE INDEX IF NOT EXISTS trust_ledger_entries_external_id_key + ON public.trust_ledger_entries (external_id) WHERE external_id IS NOT NULL; \ No newline at end of file