diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2023-03-04 18:40:37 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2023-03-04 18:40:37 +0900 |
commit | 88b7a0784e0c9e66dad26e0d85ee06ce9f7c59b9 (patch) | |
tree | ffd9ae8bb6bb092958712ab0a20d36baa6747c0f /revert | |
parent | 33540101422d874e798c1852391eed19b16c600e (diff) |
Make transaction type integer.
Diffstat (limited to 'revert')
-rw-r--r-- | revert/transaction_type_to_integer.sql | 8 |
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; |