From c463e60122d6e526c1ac4e04c5945af13e902ba8 Mon Sep 17 00:00:00 2001 From: Aria Stewart Date: Mon, 29 Nov 2010 01:23:09 +0100 Subject: [PATCH] Add query docs --- doc/queries/credit | 6 ++++++ doc/queries/work | 6 ++++++ 2 files changed, 12 insertions(+) create mode 100644 doc/queries/credit create mode 100644 doc/queries/work diff --git a/doc/queries/credit b/doc/queries/credit new file mode 100644 index 0000000..538ecfd --- /dev/null +++ b/doc/queries/credit @@ -0,0 +1,6 @@ +-- variables: reason, amount, account +BEGIN TRANSACTION; +INSERT INTO transactions (date, memo) VALUES (now(), 'Credit for #{reason}'); +INSERT INTO transaction_items (transaction_id, account_id, amount) VALUES (currval('transactions_id_seq'), #{account}, #{-amount}); +INSERT INTO transaction_items (transaction_id, account_id, amount) VALUES (currval('transactions_id_seq'), 1302, #{amount}); +COMMIT; diff --git a/doc/queries/work b/doc/queries/work new file mode 100644 index 0000000..eb3fe2e --- /dev/null +++ b/doc/queries/work @@ -0,0 +1,6 @@ +-- variables: reason, amount, account +BEGIN TRANSACTION; +INSERT INTO transactions (date, memo) VALUES ('2004-10-01', 'Dialup through Nov 1'); +INSERT INTO transaction_items (transaction_id, account_id, amount) VALUES (currval('transactions_id_seq'), 1351, 7.0); +INSERT INTO transaction_items (transaction_id, account_id, amount) VALUES (currval('transactions_id_seq'), 1302, -7.0); +COMMIT;