aboutsummaryrefslogtreecommitdiff
path: root/revert
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2023-03-28 00:14:44 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2023-03-28 00:17:28 +0900
commit245f705e51429a7cd152039ca2b3b6b63c619464 (patch)
tree14ed488ab2638bd74f5d3e42c62f2b9b76757a34 /revert
parent5b81d494781947352b3c18336aa132c94361987e (diff)
Change kakeibo.update_timestamp to common.update_timestamp.
Diffstat (limited to 'revert')
-rw-r--r--revert/articles_update_timestamp.sql9
-rw-r--r--revert/articles_update_timestamp@v1.0.0-alpha.3.sql7
-rw-r--r--revert/items_update_timestamp.sql9
-rw-r--r--revert/items_update_timestamp@v1.0.0-alpha.3.sql7
-rw-r--r--revert/transactions_update_timestamp.sql9
-rw-r--r--revert/transactions_update_timestamp@v1.0.0-alpha.3.sql7
6 files changed, 42 insertions, 6 deletions
diff --git a/revert/articles_update_timestamp.sql b/revert/articles_update_timestamp.sql
index 3ce73d1..56e4503 100644
--- a/revert/articles_update_timestamp.sql
+++ b/revert/articles_update_timestamp.sql
@@ -1,7 +1,12 @@
--- Revert kakeibo:articles_update_timestamp from pg
+-- Deploy kakeibo:articles_update_timestamp to pg
+-- requires: articles
+-- requires: update_timestamp
BEGIN;
-DROP TRIGGER update_timestamp ON kakeibo.articles;
+CREATE OR REPLACE TRIGGER update_timestamp
+ BEFORE UPDATE ON kakeibo.articles
+ FOR EACH ROW
+ EXECUTE FUNCTION kakeibo.update_timestamp();
COMMIT;
diff --git a/revert/articles_update_timestamp@v1.0.0-alpha.3.sql b/revert/articles_update_timestamp@v1.0.0-alpha.3.sql
new file mode 100644
index 0000000..3ce73d1
--- /dev/null
+++ b/revert/articles_update_timestamp@v1.0.0-alpha.3.sql
@@ -0,0 +1,7 @@
+-- Revert kakeibo:articles_update_timestamp from pg
+
+BEGIN;
+
+DROP TRIGGER update_timestamp ON kakeibo.articles;
+
+COMMIT;
diff --git a/revert/items_update_timestamp.sql b/revert/items_update_timestamp.sql
index 52ce12f..f9258b2 100644
--- a/revert/items_update_timestamp.sql
+++ b/revert/items_update_timestamp.sql
@@ -1,7 +1,12 @@
--- Revert kakeibo:items_update_timestamp from pg
+-- Deploy kakeibo:items_update_timestamp to pg
+-- requires: items
+-- requires: update_timestamp
BEGIN;
-DROP TRIGGER update_timestamp ON kakeibo.items;
+CREATE OR REPLACE TRIGGER update_timestamp
+ BEFORE UPDATE ON kakeibo.items
+ FOR EACH ROW
+ EXECUTE FUNCTION kakeibo.update_timestamp();
COMMIT;
diff --git a/revert/items_update_timestamp@v1.0.0-alpha.3.sql b/revert/items_update_timestamp@v1.0.0-alpha.3.sql
new file mode 100644
index 0000000..52ce12f
--- /dev/null
+++ b/revert/items_update_timestamp@v1.0.0-alpha.3.sql
@@ -0,0 +1,7 @@
+-- Revert kakeibo:items_update_timestamp from pg
+
+BEGIN;
+
+DROP TRIGGER update_timestamp ON kakeibo.items;
+
+COMMIT;
diff --git a/revert/transactions_update_timestamp.sql b/revert/transactions_update_timestamp.sql
index c9bee8f..23c126a 100644
--- a/revert/transactions_update_timestamp.sql
+++ b/revert/transactions_update_timestamp.sql
@@ -1,7 +1,12 @@
--- Revert kakeibo:transactions_update_timestamp from pg
+-- Deploy kakeibo:transactions_update_timestamp to pg
+-- requires: transactions
+-- requires: update_timestamp
BEGIN;
-DROP TRIGGER update_timestamp ON kakeibo.transactions;
+CREATE OR REPLACE TRIGGER update_timestamp
+ BEFORE UPDATE ON kakeibo.transactions
+ FOR EACH ROW
+ EXECUTE FUNCTION kakeibo.update_timestamp();
COMMIT;
diff --git a/revert/transactions_update_timestamp@v1.0.0-alpha.3.sql b/revert/transactions_update_timestamp@v1.0.0-alpha.3.sql
new file mode 100644
index 0000000..c9bee8f
--- /dev/null
+++ b/revert/transactions_update_timestamp@v1.0.0-alpha.3.sql
@@ -0,0 +1,7 @@
+-- Revert kakeibo:transactions_update_timestamp from pg
+
+BEGIN;
+
+DROP TRIGGER update_timestamp ON kakeibo.transactions;
+
+COMMIT;