From f011f99514c304521e14eb00b2c6e6d4b2c3dd11 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Mon, 13 Mar 2023 00:23:26 +0900 Subject: Add table to manage transaction type codes. --- deploy/transaction_types.sql | 12 ++++++++++++ revert/transaction_types.sql | 7 +++++++ sqitch.plan | 2 ++ verify/transaction_types.sql | 10 ++++++++++ 4 files changed, 31 insertions(+) create mode 100644 deploy/transaction_types.sql create mode 100644 revert/transaction_types.sql create mode 100644 verify/transaction_types.sql diff --git a/deploy/transaction_types.sql b/deploy/transaction_types.sql new file mode 100644 index 0000000..cf07925 --- /dev/null +++ b/deploy/transaction_types.sql @@ -0,0 +1,12 @@ +-- Deploy kakeibo:transaction_types to pg +-- requires: schema + +BEGIN; + +CREATE TABLE kakeibo.transaction_types ( + code INTEGER PRIMARY KEY, + name TEXT NOT NULL +); +INSERT INTO kakeibo.transaction_types VALUES (0, 'outgo'), (1, 'income'); + +COMMIT; diff --git a/revert/transaction_types.sql b/revert/transaction_types.sql new file mode 100644 index 0000000..48df263 --- /dev/null +++ b/revert/transaction_types.sql @@ -0,0 +1,7 @@ +-- Revert kakeibo:transaction_types from pg + +BEGIN; + +DROP TABLE kakeibo.transaction_types; + +COMMIT; diff --git a/sqitch.plan b/sqitch.plan index cbd7806..870ff72 100644 --- a/sqitch.plan +++ b/sqitch.plan @@ -18,3 +18,5 @@ articles [schema] 2023-03-12T14:43:06Z Masaya Tojo # Add tab transactions [transactions@v1.0.0-alpha.1 articles] 2023-03-12T15:06:03Z Masaya Tojo # Add article_id column to transactions table. items [items@v1.0.0-alpha.1 articles] 2023-03-12T15:12:15Z Masaya Tojo # Add article_id column to items table. @v1.0.0-alpha.2 2023-03-12T15:18:49Z Masaya Tojo # Tag v1.0.0-alpha.2. + +transaction_types [schema] 2023-03-12T15:20:07Z Masaya Tojo # Add table to manage transaction type codes. diff --git a/verify/transaction_types.sql b/verify/transaction_types.sql new file mode 100644 index 0000000..49aa2f6 --- /dev/null +++ b/verify/transaction_types.sql @@ -0,0 +1,10 @@ +-- Verify kakeibo:transaction_types on pg + +BEGIN; + +SELECT code, + name + FROM kakeibo.transaction_types + WHERE FALSE; + +ROLLBACK; -- cgit v1.2.3