Fix update script for now to clock_timestamp

This commit is contained in:
Clemens Schwaighofer
2024-12-12 19:04:21 +09:00
parent e793c3975b
commit 540269e61f

View File

@@ -22,11 +22,11 @@ DECLARE
random_length INT = 25; -- that should be long enough
BEGIN
IF TG_OP = 'INSERT' THEN
NEW.date_created := 'now';
NEW.date_created := clock_timestamp();
NEW.cuid := random_string(random_length);
NEW.cuuid := gen_random_uuid();
ELSIF TG_OP = 'UPDATE' THEN
NEW.date_updated := 'now';
NEW.date_updated := clock_timestamp();
END IF;
RETURN NEW;
END;