From 62ce03796ba8e43277ba3f5acbf55cfb76591416 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Mon, 11 Mar 2024 00:31:23 +0900 Subject: Add update_updated_at trigger to articles table. --- verify/articles_update_updated_at.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 verify/articles_update_updated_at.sql (limited to 'verify/articles_update_updated_at.sql') diff --git a/verify/articles_update_updated_at.sql b/verify/articles_update_updated_at.sql new file mode 100644 index 0000000..744b1fd --- /dev/null +++ b/verify/articles_update_updated_at.sql @@ -0,0 +1,14 @@ +-- Verify diary:articles_update_updated_at on pg + +BEGIN; + +DO $$ + BEGIN + ASSERT (SELECT 1 from information_schema.triggers + WHERE trigger_schema = 'diary' + AND event_object_table = 'articles' + AND trigger_name = 'update_updated_at'); + END +$$; + +ROLLBACK; -- cgit v1.2.3