aboutsummaryrefslogtreecommitdiff
path: root/deploy
diff options
context:
space:
mode:
Diffstat (limited to 'deploy')
-rw-r--r--deploy/delete_item.sql15
-rw-r--r--deploy/delete_transaction.sql15
-rw-r--r--deploy/insert_item.sql25
-rw-r--r--deploy/insert_transaction.sql24
4 files changed, 0 insertions, 79 deletions
diff --git a/deploy/delete_item.sql b/deploy/delete_item.sql
deleted file mode 100644
index 38b3083..0000000
--- a/deploy/delete_item.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- Deploy kakeibo:delete_item to pg
--- requires: schema
--- requires: items
-
-BEGIN;
-
-CREATE OR REPLACE FUNCTION kakeibo.delete_item(
- p_item_id INTEGER
-) RETURNS VOID AS $$
- BEGIN
- DELETE FROM kakeibo.items WHERE id = p_item_id;
- END;
-$$ LANGUAGE plpgsql SECURITY DEFINER;
-
-COMMIT;
diff --git a/deploy/delete_transaction.sql b/deploy/delete_transaction.sql
deleted file mode 100644
index d3c23de..0000000
--- a/deploy/delete_transaction.sql
+++ /dev/null
@@ -1,15 +0,0 @@
--- 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;
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;
diff --git a/deploy/insert_transaction.sql b/deploy/insert_transaction.sql
deleted file mode 100644
index eb5a38e..0000000
--- a/deploy/insert_transaction.sql
+++ /dev/null
@@ -1,24 +0,0 @@
--- Deploy kakeibo:insert_transaction to pg
--- requires: schema
--- requires: transactions
-
-BEGIN;
-
-CREATE OR REPLACE FUNCTION kakeibo.insert_transaction(
- p_type_code INTEGER,
- p_date DATE,
- p_note TEXT
-) RETURNS INTEGER AS $$
- DECLARE
- inserted_id INTEGER;
- BEGIN
- INSERT INTO kakeibo.transactions (
- type_code, date, note
- ) VALUES (
- p_type_code, p_date, p_note
- ) RETURNING id INTO inserted_id;
- RETURN inserted_id;
- END;
-$$ LANGUAGE plpgsql SECURITY DEFINER;
-
-COMMIT;