diff options
-rw-r--r-- | deploy/article_taggings.sql | 16 | ||||
-rw-r--r-- | revert/article_taggings.sql | 9 | ||||
-rw-r--r-- | sqitch.plan | 1 | ||||
-rw-r--r-- | verify/article_taggings.sql | 11 |
4 files changed, 37 insertions, 0 deletions
diff --git a/deploy/article_taggings.sql b/deploy/article_taggings.sql new file mode 100644 index 0000000..3985543 --- /dev/null +++ b/deploy/article_taggings.sql @@ -0,0 +1,16 @@ +-- Deploy diary:article_taggings to pg +-- requires: schema +-- requires: tags +-- requires: articles + +BEGIN; + +SET search_path to diary; + +CREATE TABLE article_taggings( + article_id UUID REFERENCES articles(id), + tag_id INT REFERENCES tags(id), + PRIMARY KEY(article_id, tag_id) +); + +COMMIT; diff --git a/revert/article_taggings.sql b/revert/article_taggings.sql new file mode 100644 index 0000000..6f0d57c --- /dev/null +++ b/revert/article_taggings.sql @@ -0,0 +1,9 @@ +-- Revert diary:article_taggings from pg + +BEGIN; + +SET search_path to diary; + +DROP TABLE article_taggings; + +COMMIT; diff --git a/sqitch.plan b/sqitch.plan index 71228b4..c500b49 100644 --- a/sqitch.plan +++ b/sqitch.plan @@ -5,3 +5,4 @@ schema 2024-03-10T11:00:19Z Masaya Tojo <masaya@tojo.tokyo> # Add schema for diary objects. articles [schema] 2024-03-10T13:54:19Z Masaya Tojo <masaya@tojo.tokyo> # Add table manage diary articles. tags [schema] 2024-03-10T15:55:56Z Masaya Tojo <masaya@tojo.tokyo> # Add table manage diary tags. +article_taggings [schema tags articles] 2024-03-15T17:54:50Z Masaya Tojo <masaya@tojo.tokyo> # Add table for tagging articles. diff --git a/verify/article_taggings.sql b/verify/article_taggings.sql new file mode 100644 index 0000000..9947337 --- /dev/null +++ b/verify/article_taggings.sql @@ -0,0 +1,11 @@ +-- Verify diary:article_taggings on pg + +BEGIN; + +SET search_path to diary; + +SELECT article_id, tag_id + FROM article_taggings + WHERE FALSE; + +ROLLBACK; |