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:
2026-06-16 21:52:44 -03:00
parent 33b1d47229
commit 025393cd43
14 changed files with 82 additions and 1208 deletions

View 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);