aboutsummaryrefslogtreecommitdiff
path: root/revert
diff options
context:
space:
mode:
Diffstat (limited to 'revert')
-rw-r--r--revert/update_timestamp.sql11
-rw-r--r--revert/update_timestamp@v1.0.0-alpha.2.sql7
2 files changed, 16 insertions, 2 deletions
diff --git a/revert/update_timestamp.sql b/revert/update_timestamp.sql
index 07074ac..30f9c6d 100644
--- a/revert/update_timestamp.sql
+++ b/revert/update_timestamp.sql
@@ -1,7 +1,14 @@
--- Revert kakeibo:update_timestamp from pg
+-- Deploy kakeibo:update_timestamp to pg
+-- requires: schema
BEGIN;
-DROP FUNCTION kakeibo.update_timestamp;
+DROP FUNCTION common.update_timestamp();
+CREATE OR REPLACE FUNCTION kakeibo.update_timestamp() RETURNS TRIGGER AS $$
+ BEGIN
+ NEW.updated_at = NOW();
+ RETURN NEW;
+ END;
+$$ LANGUAGE plpgsql;
COMMIT;
diff --git a/revert/update_timestamp@v1.0.0-alpha.2.sql b/revert/update_timestamp@v1.0.0-alpha.2.sql
new file mode 100644
index 0000000..07074ac
--- /dev/null
+++ b/revert/update_timestamp@v1.0.0-alpha.2.sql
@@ -0,0 +1,7 @@
+-- Revert kakeibo:update_timestamp from pg
+
+BEGIN;
+
+DROP FUNCTION kakeibo.update_timestamp;
+
+COMMIT;