aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deploy/tags.sql (renamed from deploy/article_tags.sql)4
-rw-r--r--deploy/tags_update_updated_at.sql (renamed from deploy/article_tags_update_updated_at.sql)6
-rw-r--r--revert/article_tags.sql9
-rw-r--r--revert/article_tags_update_updated_at.sql9
-rw-r--r--revert/tags.sql9
-rw-r--r--revert/tags_update_updated_at.sql9
-rw-r--r--sqitch.plan4
-rw-r--r--verify/tags.sql (renamed from verify/article_tags.sql)4
-rw-r--r--verify/tags_update_updated_at.sql (renamed from verify/article_tags_update_updated_at.sql)4
9 files changed, 29 insertions, 29 deletions
diff --git a/deploy/article_tags.sql b/deploy/tags.sql
index 617dcdc..8186248 100644
--- a/deploy/article_tags.sql
+++ b/deploy/tags.sql
@@ -1,11 +1,11 @@
--- Deploy diary:article_tags to pg
+-- Deploy diary:tags to pg
-- requires: schema
BEGIN;
SET search_path to diary;
-CREATE TABLE article_tags(
+CREATE TABLE tags(
id UUID PRIMARY KEY,
name TEXT UNIQUE NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
diff --git a/deploy/article_tags_update_updated_at.sql b/deploy/tags_update_updated_at.sql
index 20d3bc7..42e860b 100644
--- a/deploy/article_tags_update_updated_at.sql
+++ b/deploy/tags_update_updated_at.sql
@@ -1,6 +1,6 @@
--- Deploy diary:article_tags_update_updated_at to pg
+-- Deploy diary:tags_update_updated_at to pg
-- requires: schema
--- requires: article_tags
+-- requires: tags
-- requires: update_updated_at
BEGIN;
@@ -8,7 +8,7 @@ BEGIN;
SET search_path to diary;
CREATE OR REPLACE TRIGGER update_updated_at
- BEFORE UPDATE ON article_tags
+ BEFORE UPDATE ON tags
FOR EACH ROW
EXECUTE FUNCTION update_updated_at();
diff --git a/revert/article_tags.sql b/revert/article_tags.sql
deleted file mode 100644
index 57478d0..0000000
--- a/revert/article_tags.sql
+++ /dev/null
@@ -1,9 +0,0 @@
--- Revert diary:article_tags from pg
-
-BEGIN;
-
-SET search_path to diary;
-
-DROP TABLE article_tags;
-
-COMMIT;
diff --git a/revert/article_tags_update_updated_at.sql b/revert/article_tags_update_updated_at.sql
deleted file mode 100644
index 7a668ab..0000000
--- a/revert/article_tags_update_updated_at.sql
+++ /dev/null
@@ -1,9 +0,0 @@
--- Revert diary:article_tags_update_updated_at from pg
-
-BEGIN;
-
-SET search_path to diary;
-
-DROP TRIGGER update_updated_at ON article_tags;
-
-COMMIT;
diff --git a/revert/tags.sql b/revert/tags.sql
new file mode 100644
index 0000000..f3926b4
--- /dev/null
+++ b/revert/tags.sql
@@ -0,0 +1,9 @@
+-- Revert diary:tags from pg
+
+BEGIN;
+
+SET search_path to diary;
+
+DROP TABLE tags;
+
+COMMIT;
diff --git a/revert/tags_update_updated_at.sql b/revert/tags_update_updated_at.sql
new file mode 100644
index 0000000..d9ef214
--- /dev/null
+++ b/revert/tags_update_updated_at.sql
@@ -0,0 +1,9 @@
+-- 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/sqitch.plan b/sqitch.plan
index ec848cf..4335ed3 100644
--- a/sqitch.plan
+++ b/sqitch.plan
@@ -6,5 +6,5 @@ schema 2024-03-10T11:00:19Z Masaya Tojo <masaya@tojo.tokyo> # Add schema for dia
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.
-article_tags [schema] 2024-03-10T15:55:56Z Masaya Tojo <masaya@tojo.tokyo> # Add table manage diary article tags.
-article_tags_update_updated_at [schema article_tags update_updated_at] 2024-03-10T16:06:54Z Masaya Tojo <masaya@tojo.tokyo> # Add update_updated_at trigger to article_tags 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/article_tags.sql b/verify/tags.sql
index 46119c3..5d6b174 100644
--- a/verify/article_tags.sql
+++ b/verify/tags.sql
@@ -1,11 +1,11 @@
--- Verify diary:article_tags on pg
+-- Verify diary:tags on pg
BEGIN;
SET search_path to diary;
SELECT id, name, created_at, updated_at
- FROM article_tags
+ FROM tags
WHERE FALSE;
ROLLBACK;
diff --git a/verify/article_tags_update_updated_at.sql b/verify/tags_update_updated_at.sql
index 7ee95db..e6940ce 100644
--- a/verify/article_tags_update_updated_at.sql
+++ b/verify/tags_update_updated_at.sql
@@ -1,4 +1,4 @@
--- Verify diary:article_tags_update_updated_at on pg
+-- Verify diary:tags_update_updated_at on pg
BEGIN;
@@ -6,7 +6,7 @@ DO $$
BEGIN
ASSERT (SELECT 1 from information_schema.triggers
WHERE trigger_schema = 'diary'
- AND event_object_table = 'article_tags'
+ AND event_object_table = 'tags'
AND trigger_name = 'update_updated_at');
END
$$;