aboutsummaryrefslogtreecommitdiff
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/delete_item.sql14
-rw-r--r--deploy/insert_item.sql4
2 files changed, 16 insertions, 2 deletions
diff --git a/deploy/delete_item.sql b/deploy/delete_item.sql
new file mode 100644
index 0000000..51dbcf5
--- /dev/null
+++ b/deploy/delete_item.sql
@@ -0,0 +1,14 @@
+-- Deploy kakeibo:delete_item to pg
+-- requires: appschema
+-- requires: items
+
+BEGIN;
+
+CREATE OR REPLACE FUNCTION kakeibo.delete_item(p_id integer)
+ RETURNS VOID AS $$
+BEGIN
+ DELETE FROM kakeibo.items WHERE id = p_id;
+END;
+$$ LANGUAGE plpgsql SECURITY DEFINER;
+
+COMMIT;
diff --git a/deploy/insert_item.sql b/deploy/insert_item.sql
index a0a5b5c..7f62e14 100644
--- a/deploy/insert_item.sql
+++ b/deploy/insert_item.sql
@@ -4,8 +4,8 @@
BEGIN;
-CREATE OR REPLACE FUNCTION kakeibo.insert_transaction(
- p_transaction_id INTEER,
+CREATE OR REPLACE FUNCTION kakeibo.insert_item(
+ p_transaction_id INTEGER,
p_category TEXT,
p_subcategory TEXT,
p_amount INTEGER,