diff --git a/src/integrations/supabase/types.ts b/src/integrations/supabase/types.ts index 00f29fb..50a58eb 100644 --- a/src/integrations/supabase/types.ts +++ b/src/integrations/supabase/types.ts @@ -64,6 +64,13 @@ export type Database = { updated_at?: string } Relationships: [ + { + foreignKeyName: "cases_assigned_attorney_id_fkey" + columns: ["assigned_attorney_id"] + isOneToOne: false + referencedRelation: "profiles" + referencedColumns: ["id"] + }, { foreignKeyName: "cases_client_id_fkey" columns: ["client_id"] diff --git a/supabase/migrations/20260416235745_a0fea66b-4712-44c7-be15-31964c9f755c.sql b/supabase/migrations/20260416235745_a0fea66b-4712-44c7-be15-31964c9f755c.sql new file mode 100644 index 0000000..5cf2500 --- /dev/null +++ b/supabase/migrations/20260416235745_a0fea66b-4712-44c7-be15-31964c9f755c.sql @@ -0,0 +1,9 @@ +ALTER TABLE public.cases DROP CONSTRAINT IF EXISTS cases_assigned_attorney_id_fkey; + +ALTER TABLE public.cases + ADD CONSTRAINT cases_assigned_attorney_id_fkey + FOREIGN KEY (assigned_attorney_id) + REFERENCES public.profiles(id) + ON DELETE SET NULL; + +NOTIFY pgrst, 'reload schema'; \ No newline at end of file