aboutsummaryrefslogtreecommitdiff
path: root/deploy
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2024-03-17 17:33:46 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2024-03-17 17:34:25 +0900
commit63eaf4837fef5ea76a9249a752041d58e51eba0f (patch)
treeb75369c8c4fe5251ae665ad21924888e90347cbc /deploy
parent1cbd623da4d1eb4f6b44f9b1d72978dd7cdbd412 (diff)
Rename column name from `id` to `<name>_id`.
Diffstat (limited to 'deploy')
-rw-r--r--deploy/article_links.sql4
-rw-r--r--deploy/article_taggings.sql4
-rw-r--r--deploy/articles.sql2
-rw-r--r--deploy/tags.sql2
4 files changed, 6 insertions, 6 deletions
diff --git a/deploy/article_links.sql b/deploy/article_links.sql
index b562ffc..c39c814 100644
--- a/deploy/article_links.sql
+++ b/deploy/article_links.sql
@@ -7,8 +7,8 @@ BEGIN;
SET search_path to diary;
CREATE TABLE article_links(
- article_id UUID REFERENCES articles(id),
- linked_article_id UUID REFERENCES articles(id),
+ article_id UUID REFERENCES articles,
+ linked_article_id UUID REFERENCES articles(article_id),
PRIMARY KEY(article_id, linked_article_id)
);
diff --git a/deploy/article_taggings.sql b/deploy/article_taggings.sql
index 3985543..0719c8f 100644
--- a/deploy/article_taggings.sql
+++ b/deploy/article_taggings.sql
@@ -8,8 +8,8 @@ BEGIN;
SET search_path to diary;
CREATE TABLE article_taggings(
- article_id UUID REFERENCES articles(id),
- tag_id INT REFERENCES tags(id),
+ article_id UUID REFERENCES articles,
+ tag_id INT REFERENCES tags,
PRIMARY KEY(article_id, tag_id)
);
diff --git a/deploy/articles.sql b/deploy/articles.sql
index 6b2ca49..62505ce 100644
--- a/deploy/articles.sql
+++ b/deploy/articles.sql
@@ -6,7 +6,7 @@ BEGIN;
SET search_path to diary;
CREATE TABLE articles(
- id UUID PRIMARY KEY,
+ article_id UUID PRIMARY KEY,
timestamp TIMESTAMPTZ NOT NULL,
hash VARCHAR(64) NOT NULL,
title TEXT NOT NULL,
diff --git a/deploy/tags.sql b/deploy/tags.sql
index 3bee8ed..82a550a 100644
--- a/deploy/tags.sql
+++ b/deploy/tags.sql
@@ -6,7 +6,7 @@ BEGIN;
SET search_path to diary;
CREATE TABLE tags(
- id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
+ tag_id INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY,
name varchar UNIQUE NOT NULL
);