From 8ec394a74e264a338c1ce108b47459dccd71f650 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Fri, 17 Oct 2025 17:56:51 -0600 Subject: [PATCH] =?UTF-8?q?Fix:=20Usar=20clock=5Ftimestamp()=20en=20trigge?= =?UTF-8?q?r=20updated=5Fat=20para=20garantizar=20timestamps=20=C3=BAnicos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cambiar now() por clock_timestamp() en función set_updated_at() - now() retorna el timestamp del inicio de la transacción - clock_timestamp() retorna el timestamp actual del sistema - Garantiza que cada UPDATE tenga un timestamp diferente - Mejora la precisión para auditoría de cambios --- postgres/init/02_functions.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/postgres/init/02_functions.sql b/postgres/init/02_functions.sql index ef5fda0..97aa3fd 100644 --- a/postgres/init/02_functions.sql +++ b/postgres/init/02_functions.sql @@ -8,7 +8,7 @@ CREATE OR REPLACE FUNCTION set_updated_at() RETURNS trigger LANGUAGE plpgsql AS $$ BEGIN - NEW.updated_at := now(); + NEW.updated_at := clock_timestamp(); RETURN NEW; END $$;