aboutsummaryrefslogtreecommitdiff
path: root/deploy/article_taggings.sql
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2024-03-16 03:02:02 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2024-03-16 03:02:02 +0900
commit2fb413587fc1d34045a8724b0aac60e8e8051560 (patch)
treed590f83c650e8bca7b0d4bf28e7b692f25bd531a /deploy/article_taggings.sql
parenta86f747e0db4bde6bc598a5ade8949cd8b3a4b3f (diff)
Add table for tagging articles.
Diffstat (limited to 'deploy/article_taggings.sql')
-rw-r--r--deploy/article_taggings.sql16
1 files changed, 16 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;