From b7b17d87df7e70d6774e40b864227fc3ddce4686 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Tue, 28 Feb 2023 00:52:10 +0900 Subject: Add transaction type. --- deploy/transaction_type.sql | 11 +++++++++++ revert/transaction_type.sql | 7 +++++++ sqitch.plan | 1 + verify/transaction_type.sql | 11 +++++++++++ 4 files changed, 30 insertions(+) create mode 100644 deploy/transaction_type.sql create mode 100644 revert/transaction_type.sql create mode 100644 verify/transaction_type.sql 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 # Add schema for all kakeibo objects. +transaction_type [appschema] 2023-02-27T15:51:38Z Masaya Tojo # 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; -- cgit v1.2.3