From 79c9bd6a059050bfcaf879b1854550ccffaa4d15 Mon Sep 17 00:00:00 2001
From: Masaya Tojo <masaya@tojo.tokyo>
Date: Mon, 6 Mar 2023 02:04:29 +0900
Subject: Add update_timestamp trigger to articles table.

---
 deploy/articles_update_timestamp.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 deploy/articles_update_timestamp.sql

(limited to 'deploy/articles_update_timestamp.sql')

diff --git a/deploy/articles_update_timestamp.sql b/deploy/articles_update_timestamp.sql
new file mode 100644
index 0000000..143bad4
--- /dev/null
+++ b/deploy/articles_update_timestamp.sql
@@ -0,0 +1,12 @@
+-- Deploy kakeibo:articles_update_timestamp to pg
+-- requires: articles
+-- requires: update_timestamp
+
+BEGIN;
+
+CREATE OR REPLACE TRIGGER update_timestamp
+  BEFORE UPDATE ON kakeibo.articles
+  FOR EACH ROW
+    EXECUTE FUNCTION kakeibo.update_timestamp();
+
+COMMIT;
-- 
cgit v1.2.3

