aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2023-03-12 23:53:45 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2023-03-12 23:54:12 +0900
commitaae863e98b35152e8e7c0efe7919dd105c229361 (patch)
tree3e991ce3d407d4e734097de4c0d2b00a239adca4
parent51e01e14cad5c092a1e1d0772de9ff0f5922a76e (diff)
Add table to manage articles.
-rw-r--r--deploy/articles.sql14
-rw-r--r--revert/articles.sql7
-rw-r--r--sqitch.plan2
-rw-r--r--verify/articles.sql13
4 files changed, 36 insertions, 0 deletions
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 <masaya@tojo.tokyo> #
transactions_update_timestamp [transactions update_timestamp] 2023-03-12T14:10:42Z Masaya Tojo <masaya@tojo.tokyo> # Add update_timestamp trigger to transactions table.
items_update_timestamp [items update_timestamp] 2023-03-12T14:14:13Z Masaya Tojo <masaya@tojo.tokyo> # Add update_timestamp trigger to items table.
@v1.0.0-alpha.1 2023-03-12T14:21:52Z Masaya Tojo <masaya@tojo.tokyo> # Tag v1.0.0-alpha.1.
+
+articles [schema] 2023-03-12T14:43:06Z Masaya Tojo <masaya@tojo.tokyo> # 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;