From 9ec5d9000a838e1589bae740978c676f7e0d6cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Mart=C3=ADnez?= Date: Wed, 9 Sep 2015 14:56:34 +0200 Subject: [PATCH] Readd update_updated_at function (still used by old tables) --- scripts-available/CDB_CartodbfyTable.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts-available/CDB_CartodbfyTable.sql b/scripts-available/CDB_CartodbfyTable.sql index 8074da1..fe5652d 100644 --- a/scripts-available/CDB_CartodbfyTable.sql +++ b/scripts-available/CDB_CartodbfyTable.sql @@ -280,6 +280,16 @@ BEGIN END; $$ LANGUAGE plpgsql VOLATILE; +--- Trigger to update the updated_at column. No longer added by default +--- but kept here for compatibility with old tables which still have this behavior +--- and have it added +CREATE OR REPLACE FUNCTION _CDB_update_updated_at() + RETURNS TRIGGER AS $$ +BEGIN + NEW.updated_at := now(); + RETURN NEW; +END; +$$ LANGUAGE plpgsql VOLATILE; -- Auxiliary function CREATE OR REPLACE FUNCTION cartodb._CDB_is_raster_table(schema_name TEXT, reloid REGCLASS)