Changeset ef1c1c7 for server/db/data_load.sql
- Timestamp:
- 09/24/26 17:43:19 (6 days ago)
- Branches:
- main
- Children:
- 0cee8ec
- Parents:
- a531b45
- File:
-
- 1 edited
-
server/db/data_load.sql (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
server/db/data_load.sql
ra531b45 ref1c1c7 8 8 -- 9 9 -- All sample users have the password: test123 10 -- 11 -- One transaction: the P7 checks in advanced_db.sql compare balances with 12 -- the ledger at COMMIT, and the users are inserted with their balances 13 -- before the deposit rows that back them. In an auto-commit client 14 -- (DBeaver) every statement would otherwise be checked on its own. 15 16 BEGIN; 10 17 11 18 SET search_path TO project, public; … … 104 111 -- Shows a fully-filled market buy and its resulting holding & ledger entry. 105 112 -- ============================================================================ 106 INSERT INTO project.orders (id, user_id, market_id, side, type, status, quantity, price, placed_at, executed_at) VALUES 113 -- Imported as already completely filled (filled_quantity = quantity). 114 INSERT INTO project.orders (id, user_id, market_id, side, type, status, quantity, filled_quantity, price, placed_at, executed_at) VALUES 107 115 ('c1111111-1111-1111-1111-111111111111', 108 116 'b1111111-1111-1111-1111-111111111111', 109 117 'a2222222-2222-2222-2222-222222222222', 110 'buy', 'market', 'executed', 0.5000, 3500.000000,118 'buy', 'market', 'executed', 0.5000, 0.5000, 3500.000000, 111 119 now() - interval '1 hour', now() - interval '1 hour'); 112 120 … … 118 126 INSERT INTO project.transactions (user_id, type, amount, currency, related_order, description) VALUES 119 127 ('b1111111-1111-1111-1111-111111111111', 'deposit', 10000.0000, 'USD', NULL, 128 'Initial virtual deposit'), 129 ('b2222222-2222-2222-2222-222222222222', 'deposit', 5000.0000, 'USD', NULL, 130 'Initial virtual deposit'), 131 ('b3333333-3333-3333-3333-333333333333', 'deposit', 2500.0000, 'USD', NULL, 120 132 'Initial virtual deposit'), 121 133 ('b1111111-1111-1111-1111-111111111111', 'buy', -1750.0000, 'USD', … … 143 155 ('d2222222-2222-2222-2222-222222222222', '11111111-1111-1111-1111-111111111111'), 144 156 ('d2222222-2222-2222-2222-222222222222', '55555555-5555-5555-5555-555555555555'); 157 158 COMMIT;
Note:
See TracChangeset
for help on using the changeset viewer.
