From b2aed14fd4a252d77b7ebaf42407472c47d1c98b Mon Sep 17 00:00:00 2001 From: Mateus Cruz Date: Mon, 5 Feb 2024 18:48:47 -0300 Subject: add logs and fix sql --- script.sql | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'script.sql') diff --git a/script.sql b/script.sql index 7f3f3c0..9a2b3c2 100644 --- a/script.sql +++ b/script.sql @@ -15,20 +15,25 @@ CREATE TABLE transactions ( created_at TIMESTAMPTZ NOT NULL DEFAULT NOW() ); +CREATE INDEX idx_client_id_transactions ON transactions (client_id); + CREATE TABLE balances ( id SERIAL PRIMARY KEY, client_id INTEGER REFERENCES clients, value INTEGER NOT NULL ); +CREATE INDEX idx_client_id_balances ON balances (client_id); + DO $$ BEGIN INSERT INTO clients (name, mov_limit) VALUES - ('naruto', 1000 * 100), - ('mob', 800 * 100), - ('jojo', 10000 * 100), - ('hellboy', 5000 * 100); + ('naruto', 100000), + ('mob', 80000), + ('jojo', 1000000), + ('hellboy', 10000000), + ('ultramega', 500000); INSERT INTO balances (client_id, value) SELECT id, 0 FROM clients; END; -- cgit v1.2.3