From d97bccef31c3a16be43bf94ed1632d22e61298b4 Mon Sep 17 00:00:00 2001
From: Masaya Tojo <masaya@tojo.tokyo>
Date: Wed, 1 Mar 2023 02:03:28 +0900
Subject: Add update_timestamp trigger to transactions table.

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

(limited to 'deploy/transactions_update_timestamp.sql')

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

