aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2024-03-13 00:56:38 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2024-03-13 00:57:08 +0900
commita927b30705d1e8c6b1b046e7512cc67cbdf19a21 (patch)
tree4a055da04aceac1a894ad2866f2e312669da359c
parent59e39e0088fc71225a0d5b4b1ca7df6ec9ec4659 (diff)
Remove update_updated_at functions.
-rw-r--r--deploy/articles_update_updated_at.sql15
-rw-r--r--deploy/tags_update_updated_at.sql15
-rw-r--r--deploy/update_updated_at.sql15
-rw-r--r--revert/articles_update_updated_at.sql9
-rw-r--r--revert/tags_update_updated_at.sql9
-rw-r--r--revert/update_updated_at.sql9
-rw-r--r--sqitch.plan3
-rw-r--r--verify/articles_update_updated_at.sql14
-rw-r--r--verify/tags_update_updated_at.sql14
-rw-r--r--verify/update_updated_at.sql9
10 files changed, 0 insertions, 112 deletions
diff --git a/deploy/articles_update_updated_at.sql b/deploy/articles_update_updated_at.sql
deleted file mode 100644
index 31b7ccd..0000000
--- a/deploy/articles_update_updated_at.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- 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;
diff --git a/deploy/tags_update_updated_at.sql b/deploy/tags_update_updated_at.sql
deleted file mode 100644
index 42e860b..0000000
--- a/deploy/tags_update_updated_at.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- Deploy diary:tags_update_updated_at to pg
--- requires: schema
--- requires: tags
--- requires: update_updated_at
-
-BEGIN;
-
-SET search_path to diary;
-
-CREATE OR REPLACE TRIGGER update_updated_at
- BEFORE UPDATE ON tags
- FOR EACH ROW
- EXECUTE FUNCTION update_updated_at();
-
-COMMIT;
diff --git a/deploy/update_updated_at.sql b/deploy/update_updated_at.sql
deleted file mode 100644
index a41d27f..0000000
--- a/deploy/update_updated_at.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- Deploy diary:update_updated_at to pg
--- requires: schema
-
-BEGIN;
-
-SET search_path to diary;
-
-CREATE OR REPLACE FUNCTION update_updated_at() RETURNS TRIGGER AS $$
- BEGIN
- NEW.updated_at = NOW();
- RETURN NEW;
- END;
-$$ LANGUAGE plpgsql;
-
-COMMIT;
diff --git a/revert/articles_update_updated_at.sql b/revert/articles_update_updated_at.sql
deleted file mode 100644
index bed20cf..0000000
--- a/revert/articles_update_updated_at.sql
+++ /dev/null
@@ -1,9 +0,0 @@
--- Revert diary:articles_update_updated_at from pg
-
-BEGIN;
-
-SET search_path to diary;
-
-DROP TRIGGER update_updated_at ON articles;
-
-COMMIT;
diff --git a/revert/tags_update_updated_at.sql b/revert/tags_update_updated_at.sql
deleted file mode 100644
index d9ef214..0000000
--- a/revert/tags_update_updated_at.sql
+++ /dev/null
@@ -1,9 +0,0 @@
--- Revert diary:tags_update_updated_at from pg
-
-BEGIN;
-
-SET search_path to diary;
-
-DROP TRIGGER update_updated_at ON tags;
-
-COMMIT;
diff --git a/revert/update_updated_at.sql b/revert/update_updated_at.sql
deleted file mode 100644
index 9ff67f8..0000000
--- a/revert/update_updated_at.sql
+++ /dev/null
@@ -1,9 +0,0 @@
--- Revert diary:update_updated_at from pg
-
-BEGIN;
-
-SET search_path to diary;
-
-DROP FUNCTION update_updated_at;
-
-COMMIT;
diff --git a/sqitch.plan b/sqitch.plan
index 4335ed3..71228b4 100644
--- a/sqitch.plan
+++ b/sqitch.plan
@@ -3,8 +3,5 @@
%uri=https://git.tojo.tokyo/diary-schema.git/about/
schema 2024-03-10T11:00:19Z Masaya Tojo <masaya@tojo.tokyo> # Add schema for diary objects.
-update_updated_at [schema] 2024-03-10T11:29:05Z Masaya Tojo <masaya@tojo.tokyo> # Add function to update `updated_at` column.
articles [schema] 2024-03-10T13:54:19Z Masaya Tojo <masaya@tojo.tokyo> # Add table manage diary articles.
-articles_update_updated_at [schema articles update_updated_at] 2024-03-10T15:28:20Z Masaya Tojo <masaya@tojo.tokyo> # Add update_updated_at trigger to articles table.
tags [schema] 2024-03-10T15:55:56Z Masaya Tojo <masaya@tojo.tokyo> # Add table manage diary tags.
-tags_update_updated_at [schema tags update_updated_at] 2024-03-10T16:06:54Z Masaya Tojo <masaya@tojo.tokyo> # Add update_updated_at trigger to tags table.
diff --git a/verify/articles_update_updated_at.sql b/verify/articles_update_updated_at.sql
deleted file mode 100644
index 744b1fd..0000000
--- a/verify/articles_update_updated_at.sql
+++ /dev/null
@@ -1,14 +0,0 @@
--- 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;
diff --git a/verify/tags_update_updated_at.sql b/verify/tags_update_updated_at.sql
deleted file mode 100644
index e6940ce..0000000
--- a/verify/tags_update_updated_at.sql
+++ /dev/null
@@ -1,14 +0,0 @@
--- Verify diary:tags_update_updated_at on pg
-
-BEGIN;
-
-DO $$
- BEGIN
- ASSERT (SELECT 1 from information_schema.triggers
- WHERE trigger_schema = 'diary'
- AND event_object_table = 'tags'
- AND trigger_name = 'update_updated_at');
- END
-$$;
-
-ROLLBACK;
diff --git a/verify/update_updated_at.sql b/verify/update_updated_at.sql
deleted file mode 100644
index 59c71be..0000000
--- a/verify/update_updated_at.sql
+++ /dev/null
@@ -1,9 +0,0 @@
--- Verify diary:update_updated_at on pg
-
-BEGIN;
-
-SET search_path to diary;
-
-SELECT has_function_privilege('update_updated_at()', 'EXECUTE');
-
-ROLLBACK;