From 63eaf4837fef5ea76a9249a752041d58e51eba0f Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Sun, 17 Mar 2024 17:33:46 +0900 Subject: Rename column name from `id` to `_id`. --- deploy/article_links.sql | 4 ++-- deploy/article_taggings.sql | 4 ++-- deploy/articles.sql | 2 +- deploy/tags.sql | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'deploy') 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 ); -- cgit v1.2.3