From 6b8ab6fe190e9d8f42242ff1f57be8c28e9ca066 Mon Sep 17 00:00:00 2001 From: Masaya Tojo Date: Mon, 27 Mar 2023 04:01:47 +0900 Subject: Delete insert/delete functions. --- deploy/insert_item.sql | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 deploy/insert_item.sql (limited to 'deploy/insert_item.sql') diff --git a/deploy/insert_item.sql b/deploy/insert_item.sql deleted file mode 100644 index 9f4e050..0000000 --- a/deploy/insert_item.sql +++ /dev/null @@ -1,25 +0,0 @@ --- Deploy kakeibo:insert_item to pg --- requires: schema --- requires: items - -BEGIN; - -CREATE OR REPLACE FUNCTION kakeibo.insert_item( - p_transaction_id INTEGER, - p_category TEXT, - p_subcategory TEXT, - p_amount INTEGER, - p_note TEXT -) RETURNS INTEGER AS $$ - DECLARE - inserted_id INTEGER; - BEGIN - INSERT INTO kakeibo.items (transaction_id, category, subcategory, amount, note) - VALUES (p_transaction_id, p_category, p_subcategory, p_amount, p_note) - RETURNING id INTO inserted_id; - - RETURN inserted_id; - END; -$$ LANGUAGE plpgsql SECURITY DEFINER; - -COMMIT; -- cgit v1.2.3