From d11c098d4dc87125b8f14ca235f7a4dac0bbe74b Mon Sep 17 00:00:00 2001 From: theghostmac Date: Tue, 4 Jul 2023 15:14:34 +0100 Subject: [PATCH] debug: fixed connection to postgres | create new user functionality works --- Dockerfile | 2 +- console.sql | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 console.sql diff --git a/Dockerfile b/Dockerfile index fd19b22..ac0942c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,4 +25,4 @@ FROM alpine:latest EXPOSE 8082 # Set the entrypoint to run Bankie -ENTRYPOINT ["./bankie"] \ No newline at end of file +ENTRYPOINT ["/bankie"] \ No newline at end of file diff --git a/console.sql b/console.sql new file mode 100644 index 0000000..d33704b --- /dev/null +++ b/console.sql @@ -0,0 +1,23 @@ +-- List contents of account table. +SELECT * FROM account; + +-- List all existing tables. +SELECT table_name +FROM information_schema.tables +WHERE table_schema = 'public' +ORDER BY table_name; + +-- Insert value into account table. +INSERT INTO account (first_name, last_name, email, bank_number, balance, created_at) +VALUES ('Ghost', 'Mac', 'macbobbychibuzor@gmail.com', 1234567890, 100.50, NOW()); + +-- Check type of `balance` column in account table. +SELECT column_name, data_type +FROM information_schema.columns +WHERE table_name = 'account' AND column_name = 'balance'; + +-- Change type +ALTER TABLE account ALTER COLUMN balance TYPE float8; + +-- Delete a row +DELETE FROM account WHERE id = 2;