From aae863e98b35152e8e7c0efe7919dd105c229361 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Sun, 12 Mar 2023 23:53:45 +0900 Subject: Add table to manage articles. --- deploy/articles.sql | 14 ++++++++++++++ revert/articles.sql | 7 +++++++ sqitch.plan | 2 ++ verify/articles.sql | 13 +++++++++++++ 4 files changed, 36 insertions(+) create mode 100644 deploy/articles.sql create mode 100644 revert/articles.sql create mode 100644 verify/articles.sql diff --git a/deploy/articles.sql b/deploy/articles.sql new file mode 100644 index 0000000..08fcb5e --- /dev/null +++ b/deploy/articles.sql @@ -0,0 +1,14 @@ +-- Deploy kakeibo:articles to pg +-- requires: schema + +BEGIN; + +CREATE TABLE kakeibo.articles ( + id SERIAL PRIMARY KEY, + location TEXT UNIQUE, + title TEXT NOT NULL, + created_at TIMESTAMP NOT NULL DEFAULT NOW(), + updated_at TIMESTAMP NOT NULL DEFAULT NOW() +); + +COMMIT; diff --git a/revert/articles.sql b/revert/articles.sql new file mode 100644 index 0000000..d5177d1 --- /dev/null +++ b/revert/articles.sql @@ -0,0 +1,7 @@ +-- Revert kakeibo:articles from pg + +BEGIN; + +DROP TABLE kakeibo.articles; + +COMMIT; diff --git a/sqitch.plan b/sqitch.plan index 19db70f..4e6164d 100644 --- a/sqitch.plan +++ b/sqitch.plan @@ -13,3 +13,5 @@ update_timestamp [schema] 2023-03-12T13:57:49Z Masaya Tojo # transactions_update_timestamp [transactions update_timestamp] 2023-03-12T14:10:42Z Masaya Tojo # Add update_timestamp trigger to transactions table. items_update_timestamp [items update_timestamp] 2023-03-12T14:14:13Z Masaya Tojo # Add update_timestamp trigger to items table. @v1.0.0-alpha.1 2023-03-12T14:21:52Z Masaya Tojo # Tag v1.0.0-alpha.1. + +articles [schema] 2023-03-12T14:43:06Z Masaya Tojo # Add table to manage articles. diff --git a/verify/articles.sql b/verify/articles.sql new file mode 100644 index 0000000..355d20f --- /dev/null +++ b/verify/articles.sql @@ -0,0 +1,13 @@ +-- Verify kakeibo:articles on pg + +BEGIN; + +SELECT id, + location, + title, + created_at, + updated_at + FROM kakeibo.articles + WHERE FALSE; + +ROLLBACK; -- cgit v1.2.3