From 1597c23f84346dfa44da9605286863b11006bdb5 Mon Sep 17 00:00:00 2001
From: Alexander Kavon <hawk@alexkavon.com>
Date: Tue, 28 Nov 2023 18:32:19 -0500
Subject: added migrations via tern, updated db package to connect to pgsql db,
 updated config to build db connection string, updated example .newsstand.toml
 config, new pgx dependency

---
 migrations/001_create_timestamp_trigger.sql | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 migrations/001_create_timestamp_trigger.sql

(limited to 'migrations/001_create_timestamp_trigger.sql')

diff --git a/migrations/001_create_timestamp_trigger.sql b/migrations/001_create_timestamp_trigger.sql
new file mode 100644
index 0000000..4fa369a
--- /dev/null
+++ b/migrations/001_create_timestamp_trigger.sql
@@ -0,0 +1,7 @@
+CREATE OR REPLACE FUNCTION trigger_set_timestamp()
+RETURNS TRIGGER AS $$
+BEGIN
+    NEW.updated_at = NOW();
+    RETURN NEW;
+END;
+$$ LANGUAGE plpgsql;
-- 
cgit v1.2.3

