diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2024-03-11 00:31:23 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2024-03-11 00:31:23 +0900 |
commit | 62ce03796ba8e43277ba3f5acbf55cfb76591416 (patch) | |
tree | 0be5df767ba8b13b44c1e5993b1e83abe6f1a63d /deploy | |
parent | 5039f9a506222b3f74312a4586166f5130e53817 (diff) |
Add update_updated_at trigger to articles table.
Diffstat (limited to 'deploy')
-rw-r--r-- | deploy/articles_update_updated_at.sql | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/deploy/articles_update_updated_at.sql b/deploy/articles_update_updated_at.sql new file mode 100644 index 0000000..31b7ccd --- /dev/null +++ b/deploy/articles_update_updated_at.sql @@ -0,0 +1,15 @@ +-- Deploy diary:articles_update_updated_at to pg +-- requires: schema +-- requires: articles +-- requires: update_updated_at + +BEGIN; + +SET search_path to diary; + +CREATE OR REPLACE TRIGGER update_updated_at + BEFORE UPDATE ON articles + FOR EACH ROW + EXECUTE FUNCTION update_updated_at(); + +COMMIT; |