aboutsummaryrefslogtreecommitdiff
path: root/revert
diff options
context:
space:
mode:
Diffstat (limited to 'revert')
-rw-r--r--revert/transaction_type_to_integer.sql8
1 files changed, 8 insertions, 0 deletions
diff --git a/revert/transaction_type_to_integer.sql b/revert/transaction_type_to_integer.sql
new file mode 100644
index 0000000..482583e
--- /dev/null
+++ b/revert/transaction_type_to_integer.sql
@@ -0,0 +1,8 @@
+-- Revert kakeibo:transaction_type_to_integer from pg
+
+BEGIN;
+
+ALTER TABLE kakeibo.transactions ALTER COLUMN type TYPE kakeibo.transaction_type
+ USING CASE type WHEN 0 THEN 'outgo'::kakeibo.transaction_type ELSE 'income'::kakeibo.transaction_type END;
+
+COMMIT;