Corrección 1 — Delete de proceso restaurado +
This commit is contained in:
18
supabase/migrations/008_create_gateways.sql
Normal file
18
supabase/migrations/008_create_gateways.sql
Normal file
@@ -0,0 +1,18 @@
|
||||
CREATE TABLE IF NOT EXISTS public.gateways (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
process_id uuid NOT NULL REFERENCES public.processes(id) ON DELETE CASCADE,
|
||||
bpmn_element_id text NOT NULL,
|
||||
gateway_type text NOT NULL CHECK (gateway_type IN ('exclusive','parallel','inclusive','event-based')),
|
||||
branches jsonb NOT NULL DEFAULT '[]',
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS gateways_process_bpmn_idx
|
||||
ON public.gateways(process_id, bpmn_element_id);
|
||||
|
||||
ALTER TABLE public.gateways ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
CREATE POLICY "all_gateways" ON public.gateways
|
||||
FOR ALL USING (auth.uid() IS NOT NULL)
|
||||
WITH CHECK (auth.uid() IS NOT NULL);
|
||||
Reference in New Issue
Block a user