From 88b7a0784e0c9e66dad26e0d85ee06ce9f7c59b9 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Sat, 4 Mar 2023 18:40:37 +0900 Subject: Make transaction type integer. --- deploy/transaction_type_to_integer.sql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 deploy/transaction_type_to_integer.sql (limited to 'deploy') diff --git a/deploy/transaction_type_to_integer.sql b/deploy/transaction_type_to_integer.sql new file mode 100644 index 0000000..8f18f5a --- /dev/null +++ b/deploy/transaction_type_to_integer.sql @@ -0,0 +1,10 @@ +-- Deploy kakeibo:transaction_type_to_integer to pg +-- requires: transactions + +BEGIN; + +ALTER TABLE kakeibo.transactions + ALTER COLUMN type TYPE integer + USING CASE type WHEN 'outgo' THEN 0 ELSE 1 END; + +COMMIT; -- cgit v1.2.3