From 59e39e0088fc71225a0d5b4b1ca7df6ec9ec4659 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Tue, 12 Mar 2024 02:52:57 +0900 Subject: Rename article_tags to tags. --- deploy/article_tags.sql | 15 --------------- deploy/article_tags_update_updated_at.sql | 15 --------------- deploy/tags.sql | 15 +++++++++++++++ deploy/tags_update_updated_at.sql | 15 +++++++++++++++ 4 files changed, 30 insertions(+), 30 deletions(-) delete mode 100644 deploy/article_tags.sql delete mode 100644 deploy/article_tags_update_updated_at.sql create mode 100644 deploy/tags.sql create mode 100644 deploy/tags_update_updated_at.sql (limited to 'deploy') diff --git a/deploy/article_tags.sql b/deploy/article_tags.sql deleted file mode 100644 index 617dcdc..0000000 --- a/deploy/article_tags.sql +++ /dev/null @@ -1,15 +0,0 @@ --- 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/deploy/article_tags_update_updated_at.sql b/deploy/article_tags_update_updated_at.sql deleted file mode 100644 index 20d3bc7..0000000 --- a/deploy/article_tags_update_updated_at.sql +++ /dev/null @@ -1,15 +0,0 @@ --- Deploy diary:article_tags_update_updated_at to pg --- requires: schema --- requires: article_tags --- requires: update_updated_at - -BEGIN; - -SET search_path to diary; - -CREATE OR REPLACE TRIGGER update_updated_at - BEFORE UPDATE ON article_tags - FOR EACH ROW - EXECUTE FUNCTION update_updated_at(); - -COMMIT; diff --git a/deploy/tags.sql b/deploy/tags.sql new file mode 100644 index 0000000..8186248 --- /dev/null +++ b/deploy/tags.sql @@ -0,0 +1,15 @@ +-- Deploy diary:tags to pg +-- requires: schema + +BEGIN; + +SET search_path to diary; + +CREATE TABLE 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/deploy/tags_update_updated_at.sql b/deploy/tags_update_updated_at.sql new file mode 100644 index 0000000..42e860b --- /dev/null +++ b/deploy/tags_update_updated_at.sql @@ -0,0 +1,15 @@ +-- Deploy diary:tags_update_updated_at to pg +-- requires: schema +-- requires: tags +-- requires: update_updated_at + +BEGIN; + +SET search_path to diary; + +CREATE OR REPLACE TRIGGER update_updated_at + BEFORE UPDATE ON tags + FOR EACH ROW + EXECUTE FUNCTION update_updated_at(); + +COMMIT; -- cgit v1.2.3