Skip to content

Commit

Permalink
Add query docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aredridel committed Nov 29, 2010
1 parent 5fb76d5 commit c463e60
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions 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;
6 changes: 6 additions & 0 deletions 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;

0 comments on commit c463e60

Please sign in to comment.