Commit pendiente de Etapas 3+4. Son cambios validados (migraciones corriendo, build verde, 521 tests). Hay que commitearlos antes de empezar la siguiente etapa.
This commit is contained in:
17
supabase/migrations/009_create_simulations.sql
Normal file
17
supabase/migrations/009_create_simulations.sql
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE IF NOT EXISTS public.simulations (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
process_id uuid NOT NULL REFERENCES public.processes(id) ON DELETE CASCADE,
|
||||
executed_at bigint NOT NULL,
|
||||
result jsonb NOT NULL,
|
||||
result_automated jsonb,
|
||||
created_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS simulations_process_executed_idx
|
||||
ON public.simulations(process_id, executed_at DESC);
|
||||
|
||||
ALTER TABLE public.simulations ENABLE ROW LEVEL SECURITY;
|
||||
|
||||
CREATE POLICY "all_simulations" ON public.simulations
|
||||
FOR ALL USING (auth.uid() IS NOT NULL)
|
||||
WITH CHECK (auth.uid() IS NOT NULL);
|
||||
Reference in New Issue
Block a user