-- 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;
