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 /deploy | |
parent | 33540101422d874e798c1852391eed19b16c600e (diff) |
Make transaction type integer.
Diffstat (limited to 'deploy')
-rw-r--r-- | deploy/transaction_type_to_integer.sql | 10 |
1 files changed, 10 insertions, 0 deletions
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; |