diff --git a/src/integrations/supabase/types.ts b/src/integrations/supabase/types.ts index de641cc..c772f27 100644 --- a/src/integrations/supabase/types.ts +++ b/src/integrations/supabase/types.ts @@ -2042,13 +2042,19 @@ export type Database = { case_id: string | null cc_addresses: string[] created_at: string + email_references: string[] from_address: string | null from_name: string | null has_attachments: boolean id: string imap_uid: number | null + in_reply_to: string | null is_archived: boolean is_read: boolean + match_reason: string | null + match_status: string + match_suggestions: Json + matched_at: string | null message_id: string | null notes: string | null raw_size_bytes: number | null @@ -2064,13 +2070,19 @@ export type Database = { case_id?: string | null cc_addresses?: string[] created_at?: string + email_references?: string[] from_address?: string | null from_name?: string | null has_attachments?: boolean id?: string imap_uid?: number | null + in_reply_to?: string | null is_archived?: boolean is_read?: boolean + match_reason?: string | null + match_status?: string + match_suggestions?: Json + matched_at?: string | null message_id?: string | null notes?: string | null raw_size_bytes?: number | null @@ -2086,13 +2098,19 @@ export type Database = { case_id?: string | null cc_addresses?: string[] created_at?: string + email_references?: string[] from_address?: string | null from_name?: string | null has_attachments?: boolean id?: string imap_uid?: number | null + in_reply_to?: string | null is_archived?: boolean is_read?: boolean + match_reason?: string | null + match_status?: string + match_suggestions?: Json + matched_at?: string | null message_id?: string | null notes?: string | null raw_size_bytes?: number | null diff --git a/supabase/migrations/20260424033142_d222b217-176a-43cf-9282-83790e13c205.sql b/supabase/migrations/20260424033142_d222b217-176a-43cf-9282-83790e13c205.sql new file mode 100644 index 0000000..59e13c4 --- /dev/null +++ b/supabase/migrations/20260424033142_d222b217-176a-43cf-9282-83790e13c205.sql @@ -0,0 +1,10 @@ +ALTER TABLE public.incoming_emails + ADD COLUMN IF NOT EXISTS in_reply_to text, + ADD COLUMN IF NOT EXISTS email_references text[] NOT NULL DEFAULT '{}', + ADD COLUMN IF NOT EXISTS match_status text NOT NULL DEFAULT 'unmatched', + ADD COLUMN IF NOT EXISTS match_suggestions jsonb NOT NULL DEFAULT '[]'::jsonb, + ADD COLUMN IF NOT EXISTS match_reason text, + ADD COLUMN IF NOT EXISTS matched_at timestamptz; + +CREATE INDEX IF NOT EXISTS incoming_emails_match_status_idx ON public.incoming_emails(match_status); +CREATE INDEX IF NOT EXISTS incoming_emails_in_reply_to_idx ON public.incoming_emails(in_reply_to); \ No newline at end of file