diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2024-03-11 01:04:48 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2024-03-11 01:04:48 +0900 |
commit | 8fdc5179b1d5ba075c74f28337f1c83e28240ed2 (patch) | |
tree | 87eb29201a7756975c229e52595bab7ad96c0163 | |
parent | 62ce03796ba8e43277ba3f5acbf55cfb76591416 (diff) |
Add table manage diary article tags.
-rw-r--r-- | deploy/article_tags.sql | 15 | ||||
-rw-r--r-- | revert/article_tags.sql | 9 | ||||
-rw-r--r-- | sqitch.plan | 1 | ||||
-rw-r--r-- | verify/article_tags.sql | 11 |
4 files changed, 36 insertions, 0 deletions
diff --git a/deploy/article_tags.sql b/deploy/article_tags.sql new file mode 100644 index 0000000..617dcdc --- /dev/null +++ b/deploy/article_tags.sql @@ -0,0 +1,15 @@ +-- Deploy diary:article_tags to pg +-- requires: schema + +BEGIN; + +SET search_path to diary; + +CREATE TABLE article_tags( + id UUID PRIMARY KEY, + name TEXT UNIQUE NOT NULL, + created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), + updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW() +); + +COMMIT; diff --git a/revert/article_tags.sql b/revert/article_tags.sql new file mode 100644 index 0000000..57478d0 --- /dev/null +++ b/revert/article_tags.sql @@ -0,0 +1,9 @@ +-- Revert diary:article_tags from pg + +BEGIN; + +SET search_path to diary; + +DROP TABLE article_tags; + +COMMIT; diff --git a/sqitch.plan b/sqitch.plan index 47af4b2..c4be025 100644 --- a/sqitch.plan +++ b/sqitch.plan @@ -6,3 +6,4 @@ 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. diff --git a/verify/article_tags.sql b/verify/article_tags.sql new file mode 100644 index 0000000..46119c3 --- /dev/null +++ b/verify/article_tags.sql @@ -0,0 +1,11 @@ +-- Verify diary:article_tags on pg + +BEGIN; + +SET search_path to diary; + +SELECT id, name, created_at, updated_at + FROM article_tags + WHERE FALSE; + +ROLLBACK; |