aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2023-04-08 14:41:24 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2023-04-08 15:14:34 +0900
commit9761a87255c1eddf23029a0492965aed713bf5de (patch)
tree70a3de0a5cc730691cf9ac685a44dbdba3ec2709
parentd89df5609e2ef7aa40c0661b3f6b331ddf6d25b6 (diff)
Add `transaction_type` enum type.
-rw-r--r--deploy/kakeibo.transaction_type.sql8
-rw-r--r--revert/kakeibo.transaction_type.sql7
-rw-r--r--sqitch.plan2
-rw-r--r--verify/kakeibo.transaction_type.sql11
4 files changed, 28 insertions, 0 deletions
diff --git a/deploy/kakeibo.transaction_type.sql b/deploy/kakeibo.transaction_type.sql
new file mode 100644
index 0000000..1d6cddf
--- /dev/null
+++ b/deploy/kakeibo.transaction_type.sql
@@ -0,0 +1,8 @@
+-- Deploy life-archive:kakeibo.transaction_type to pg
+-- requires: kakeibo
+
+BEGIN;
+
+CREATE TYPE kakeibo.transaction_type AS ENUM ('outgo', 'income');
+
+COMMIT;
diff --git a/revert/kakeibo.transaction_type.sql b/revert/kakeibo.transaction_type.sql
new file mode 100644
index 0000000..7601b35
--- /dev/null
+++ b/revert/kakeibo.transaction_type.sql
@@ -0,0 +1,7 @@
+-- Revert life-archive:kakeibo.transaction_type from pg
+
+BEGIN;
+
+DROP TYPE kakeibo.transaction_type;
+
+COMMIT;
diff --git a/sqitch.plan b/sqitch.plan
index d4c9768..54ded53 100644
--- a/sqitch.plan
+++ b/sqitch.plan
@@ -27,3 +27,5 @@ update_timestamp [update_timestamp@v1.0.0-alpha.3] 2023-03-27T15:18:34Z Masaya T
photo 2023-03-27T15:39:16Z Masaya Tojo <masaya@tojo.tokyo> # Add photo schema.
photo.photos [photo] 2023-03-27T16:00:51Z Masaya Tojo <masaya@tojo.tokyo> # Add table for tracking photos.
@v1.0.0-alpha.4 2023-04-08T04:58:15Z Masaya Tojo <masaya@tojo.tokyo> # Tag v1.0.0-alpha.4
+
+kakeibo.transaction_type [kakeibo] 2023-04-08T05:28:15Z Masaya Tojo <masaya@tojo.tokyo> # Add `transaction_type` enum type.
diff --git a/verify/kakeibo.transaction_type.sql b/verify/kakeibo.transaction_type.sql
new file mode 100644
index 0000000..9db545a
--- /dev/null
+++ b/verify/kakeibo.transaction_type.sql
@@ -0,0 +1,11 @@
+-- Verify life-archive:kakeibo.transaction_type on pg
+
+BEGIN;
+
+DO $$
+ BEGIN
+ ASSERT (select 1 from pg_type where typname = 'transaction_type');
+ END
+$$;
+
+ROLLBACK;