diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2023-02-28 00:52:10 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2023-03-01 02:28:55 +0900 |
commit | b7b17d87df7e70d6774e40b864227fc3ddce4686 (patch) | |
tree | 43edf499efaf772727987d209302b9120c7a994d | |
parent | acf7f9ecff4ddad620b85b07b4b4e6952946b385 (diff) |
Add transaction type.
-rw-r--r-- | deploy/transaction_type.sql | 11 | ||||
-rw-r--r-- | revert/transaction_type.sql | 7 | ||||
-rw-r--r-- | sqitch.plan | 1 | ||||
-rw-r--r-- | verify/transaction_type.sql | 11 |
4 files changed, 30 insertions, 0 deletions
diff --git a/deploy/transaction_type.sql b/deploy/transaction_type.sql new file mode 100644 index 0000000..b29421f --- /dev/null +++ b/deploy/transaction_type.sql @@ -0,0 +1,11 @@ +-- Deploy kakeibo:transaction_type to pg +-- requires: appschema + +BEGIN; + +CREATE TYPE kakeibo.transaction_type AS ENUM( + 'income', + 'outgo' +); + +COMMIT; diff --git a/revert/transaction_type.sql b/revert/transaction_type.sql new file mode 100644 index 0000000..00fd491 --- /dev/null +++ b/revert/transaction_type.sql @@ -0,0 +1,7 @@ +-- Revert kakeibo:transaction_type from pg + +BEGIN; + +DROP TYPE kakeibo.transaction_type; + +COMMIT; diff --git a/sqitch.plan b/sqitch.plan index e7792fe..8d4f9fd 100644 --- a/sqitch.plan +++ b/sqitch.plan @@ -3,3 +3,4 @@ %uri=http://http//git.private.tojo.tokyo/kakeibo.git appschema 2023-02-26T06:27:59Z Masaya Tojo <masaya@tojo.tokyo> # Add schema for all kakeibo objects. +transaction_type [appschema] 2023-02-27T15:51:38Z Masaya Tojo <masaya@tojo.tokyo> # Add transaction type. diff --git a/verify/transaction_type.sql b/verify/transaction_type.sql new file mode 100644 index 0000000..64de361 --- /dev/null +++ b/verify/transaction_type.sql @@ -0,0 +1,11 @@ +-- Verify kakeibo:transaction_type on pg + +BEGIN; + +DO $$ + BEGIN + ASSERT (select 1 from pg_type where typname = 'transaction_type'); + END +$$; + +ROLLBACK; |