-- Deploy kakeibo:delete_transaction to pg
-- requires: schema
-- requires: transactions

BEGIN;

CREATE OR REPLACE FUNCTION kakeibo.delete_transaction(
  p_transaction_id INTEGER
) RETURNS VOID AS $$
  BEGIN
    DELETE FROM kakeibo.transactions WHERE id = p_transaction_id;
  END;
$$ LANGUAGE plpgsql SECURITY DEFINER;

COMMIT;
