From b6d633011163002c2923f3809cd5ead2c53e2aa3 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Wed, 30 Aug 2023 00:19:17 +0900 Subject: Add update_timestamp trigger to photos table --- deploy/photos_update_timestamp.sql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 deploy/photos_update_timestamp.sql (limited to 'deploy/photos_update_timestamp.sql') diff --git a/deploy/photos_update_timestamp.sql b/deploy/photos_update_timestamp.sql new file mode 100644 index 0000000..366d3c2 --- /dev/null +++ b/deploy/photos_update_timestamp.sql @@ -0,0 +1,15 @@ +-- Deploy photos:photos_update_timestamp to pg +-- requires: schema +-- requires: photos +-- requires: update_timestamp + +BEGIN; + +SET search_path to photos; + +CREATE OR REPLACE TRIGGER update_timestamp + BEFORE UPDATE ON photos + FOR EACH ROW + EXECUTE FUNCTION update_timestamp(); + +COMMIT; -- cgit v1.2.3