diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2023-03-12 18:24:31 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2023-03-12 23:38:13 +0900 |
commit | d5ebc30b1092a89e364720b2d302b1978d62632c (patch) | |
tree | 18a3793dd83726beb14fb036928fceac93ad3be0 /deploy | |
parent | baaa9bb106af01c0d6d5fd9cde87a27852bb8622 (diff) |
Add function to delete transaction.
Diffstat (limited to 'deploy')
-rw-r--r-- | deploy/delete_transaction.sql | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/deploy/delete_transaction.sql b/deploy/delete_transaction.sql new file mode 100644 index 0000000..d3c23de --- /dev/null +++ b/deploy/delete_transaction.sql @@ -0,0 +1,15 @@ +-- 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; |