From 7852f1cf2a5be00fe0fb2d9b82cf96490bcd9ace Mon Sep 17 00:00:00 2001 From: Eduardo Silva Date: Tue, 13 Oct 2026 11:28:48 +0100 Subject: [PATCH] adding some docs related to how to develop this --- src/Makefile | 5 +- src/development.md | 14 +- .../pgdb/migrations/0001_baseline.down.sql | 1 - .../repo/pgdb/migrations/0001_baseline.up.sql | 1 - .../migrations/0001_initial_schema.down.sql | 7 + .../migrations/0001_initial_schema.up.sql | 69 ++ .../pgdb/migrations/0002_qr_feature.down.sql | 4 - .../pgdb/migrations/0002_qr_feature.up.sql | 4 - src/pgImage/.gitignore | 4 - src/pgImage/Dockerfile | 33 - src/pgImage/Makefile | 38 - src/pgImage/README.md | 9 - .../expenses_pg_2025-09-06_00:16:43.bak | 1043 ----------------- src/pgImage/healthcheck.sh | 4 - src/pgImage/start.sh | 44 - 15 files changed, 92 insertions(+), 1188 deletions(-) delete mode 100644 src/expenses/repo/pgdb/migrations/0001_baseline.down.sql delete mode 100644 src/expenses/repo/pgdb/migrations/0001_baseline.up.sql create mode 100644 src/expenses/repo/pgdb/migrations/0001_initial_schema.down.sql create mode 100644 src/expenses/repo/pgdb/migrations/0001_initial_schema.up.sql delete mode 100644 src/expenses/repo/pgdb/migrations/0002_qr_feature.down.sql delete mode 100644 src/expenses/repo/pgdb/migrations/0002_qr_feature.up.sql delete mode 100644 src/pgImage/.gitignore delete mode 100644 src/pgImage/Dockerfile delete mode 100644 src/pgImage/Makefile delete mode 100644 src/pgImage/README.md delete mode 100644 src/pgImage/expenses_pg_2025-09-06_00:16:43.bak delete mode 100755 src/pgImage/healthcheck.sh delete mode 100755 src/pgImage/start.sh diff --git a/src/Makefile b/src/Makefile index cc24ddb..2714dcd 100644 --- a/src/Makefile +++ b/src/Makefile @@ -14,7 +14,10 @@ build_release_alpine: find $(build) -name "*.ttf" ! -name DejaVuSansMono.ttf -delete devdb_start: - podman compose start database + podman compose up database --force-recreate + +devdb_clear: + podman compose down -v database devdb_status: podman compose stats database diff --git a/src/development.md b/src/development.md index 97a9574..d40f6ab 100644 --- a/src/development.md +++ b/src/development.md @@ -5,11 +5,21 @@ docker exec -i \ ``` # Start a local development database +```bash +# Use to clean the volumens and kill the current running database +podman compose down -v database +# Use to recreate database +podman compose up database --force-recreate +# Alternatively, to down the service and clear it +make devdb_clear + +# And to start it +make devdb_start +``` # Upload a database ```bash -# delete the pgsql-data-dev directory contents -# restart the container +# Don't forget to devdb_clear the current existing database psql -h 127.0.0.1 -p 5431 -U expdbuser -d expenses -f ./data.sql ``` diff --git a/src/expenses/repo/pgdb/migrations/0001_baseline.down.sql b/src/expenses/repo/pgdb/migrations/0001_baseline.down.sql deleted file mode 100644 index fc49089..0000000 --- a/src/expenses/repo/pgdb/migrations/0001_baseline.down.sql +++ /dev/null @@ -1 +0,0 @@ -SELECT * FROM expenses; diff --git a/src/expenses/repo/pgdb/migrations/0001_baseline.up.sql b/src/expenses/repo/pgdb/migrations/0001_baseline.up.sql deleted file mode 100644 index fc49089..0000000 --- a/src/expenses/repo/pgdb/migrations/0001_baseline.up.sql +++ /dev/null @@ -1 +0,0 @@ -SELECT * FROM expenses; diff --git a/src/expenses/repo/pgdb/migrations/0001_initial_schema.down.sql b/src/expenses/repo/pgdb/migrations/0001_initial_schema.down.sql new file mode 100644 index 0000000..3b95016 --- /dev/null +++ b/src/expenses/repo/pgdb/migrations/0001_initial_schema.down.sql @@ -0,0 +1,7 @@ +DROP TABLE IF EXISTS public."expensesShares"; +DROP TABLE IF EXISTS public."expensesPayments"; +DROP TABLE IF EXISTS public.expenses; +DROP TABLE IF EXISTS public.stores; +DROP TABLE IF EXISTS public."expenseTypes"; +DROP TABLE IF EXISTS public.users; +DROP TABLE IF EXISTS public.categories; diff --git a/src/expenses/repo/pgdb/migrations/0001_initial_schema.up.sql b/src/expenses/repo/pgdb/migrations/0001_initial_schema.up.sql new file mode 100644 index 0000000..e0a781e --- /dev/null +++ b/src/expenses/repo/pgdb/migrations/0001_initial_schema.up.sql @@ -0,0 +1,69 @@ +-- Create base lookup/independent tables first +CREATE TABLE public.categories ( + "CategoryID" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "CategoryName" text NOT NULL, + CONSTRAINT categories_pkey PRIMARY KEY ("CategoryID") +); + +CREATE TABLE public.users ( + "UserID" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "UserName" text NOT NULL, + "UserPass" text NOT NULL, + CONSTRAINT users_pkey PRIMARY KEY ("UserID") +); + +CREATE TABLE public."expenseTypes" ( + "TypeID" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "TypeName" text NOT NULL, + CONSTRAINT "expenseTypes_pkey" PRIMARY KEY ("TypeID") +); + +CREATE TABLE public.stores ( + "StoreID" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "StoreName" text NOT NULL, + "NIF" text DEFAULT ''::text, + CONSTRAINT stores_pkey PRIMARY KEY ("StoreID") +); + +-- Create main expenses table including the 'qr' column +CREATE TABLE public.expenses ( + "ExpID" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "Description" text NOT NULL, + "Value" numeric(12,2) DEFAULT 0 NOT NULL, + "StoreID" integer DEFAULT 0 NOT NULL, + "CategoryID" integer DEFAULT 0 NOT NULL, + "OwnerUserID" integer DEFAULT 0 NOT NULL, + "TypeID" integer DEFAULT 0 NOT NULL, + "ExpDate" timestamp without time zone NOT NULL, + "CreationDate" timestamp without time zone NOT NULL, + "PaidOff" boolean DEFAULT false, + "SharesEven" boolean DEFAULT false, + qr text DEFAULT ''::text, + CONSTRAINT expenses_pkey PRIMARY KEY ("ExpID"), + CONSTRAINT "expenses_StoreID_fkey" FOREIGN KEY ("StoreID") REFERENCES public.stores("StoreID") ON DELETE RESTRICT, + CONSTRAINT "expenses_CategoryID_fkey" FOREIGN KEY ("CategoryID") REFERENCES public.categories("CategoryID") ON DELETE RESTRICT, + CONSTRAINT "expenses_OwnerUserID_fkey" FOREIGN KEY ("OwnerUserID") REFERENCES public.users("UserID") ON DELETE RESTRICT, + CONSTRAINT "expenses_TypeID_fkey" FOREIGN KEY ("TypeID") REFERENCES public."expenseTypes"("TypeID") ON DELETE RESTRICT +); + +-- Create dependent relationship tables +CREATE TABLE public."expensesPayments" ( + "ExpPaymID" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "ExpID" integer NOT NULL, + "UserID" integer NOT NULL, + "Payed" numeric(12,2) DEFAULT 0 NOT NULL, + CONSTRAINT "expensesPayments_pkey" PRIMARY KEY ("ExpPaymID"), + CONSTRAINT "expensesPayments_ExpID_fkey" FOREIGN KEY ("ExpID") REFERENCES public.expenses("ExpID") ON DELETE RESTRICT, + CONSTRAINT "expensesPayments_UserID_fkey" FOREIGN KEY ("UserID") REFERENCES public.users("UserID") ON DELETE RESTRICT +); + +CREATE TABLE public."expensesShares" ( + "ExpShareID" integer NOT NULL GENERATED BY DEFAULT AS IDENTITY, + "ExpID" integer NOT NULL, + "UserID" integer NOT NULL, + "Share" numeric(6,2) DEFAULT 0.5 NOT NULL, + "Calculated" numeric(12,2) DEFAULT 0 NOT NULL, + CONSTRAINT "expensesShares_pkey" PRIMARY KEY ("ExpShareID"), + CONSTRAINT "expensesShares_ExpID_fkey" FOREIGN KEY ("ExpID") REFERENCES public.expenses("ExpID") ON DELETE RESTRICT, + CONSTRAINT "expensesShares_UserID_fkey" FOREIGN KEY ("UserID") REFERENCES public.users("UserID") ON DELETE RESTRICT +); diff --git a/src/expenses/repo/pgdb/migrations/0002_qr_feature.down.sql b/src/expenses/repo/pgdb/migrations/0002_qr_feature.down.sql deleted file mode 100644 index e312407..0000000 --- a/src/expenses/repo/pgdb/migrations/0002_qr_feature.down.sql +++ /dev/null @@ -1,4 +0,0 @@ ---- 0001_qr_feature.down.sql - -ALTER TABLE expenses DROP COLUMN "qr"; -ALTER TABLE stores DROP COLUMN "NIF"; diff --git a/src/expenses/repo/pgdb/migrations/0002_qr_feature.up.sql b/src/expenses/repo/pgdb/migrations/0002_qr_feature.up.sql deleted file mode 100644 index 07988d8..0000000 --- a/src/expenses/repo/pgdb/migrations/0002_qr_feature.up.sql +++ /dev/null @@ -1,4 +0,0 @@ ---- 0001_qr_feature.up.sql - -ALTER TABLE expenses ADD qr TEXT DEFAULT ''; -ALTER TABLE stores ADD "NIF" TEXT DEFAULT ''; diff --git a/src/pgImage/.gitignore b/src/pgImage/.gitignore deleted file mode 100644 index cad00c8..0000000 --- a/src/pgImage/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -schema.sql -.env -pgsql-data-dev/ -pgSocket/ diff --git a/src/pgImage/Dockerfile b/src/pgImage/Dockerfile deleted file mode 100644 index 275a1f1..0000000 --- a/src/pgImage/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ -FROM dir.esilva.org/esilva/esilva-alpine:v1.0.0 - - -# Required ENV variables for pg -ENV LANG=en_GB.utf8 - - -# Downloads the required packages for the webserver -RUN apk --no-cache add su-exec zsh \ - postgresql16 \ - && rm -rf /tmp/* - - -# Directory for the pg socket -RUN mkdir -p /run/postgresql && \ - chown -R $UNAME:$UNAME /run/postgresql -RUN mkdir -p /var/lib/postgresql/data && \ - chown -R $UNAME:$UNAME /var/lib/postgresql - - -COPY ./schema.sql /schema.sql - - -# Expose the pgsql port -EXPOSE 5431 - - -# Copies the start script -COPY ./start.sh /start.sh -COPY ./healthcheck.sh /healthcheck.sh -USER $UNAME -STOPSIGNAL SIGTERM -ENTRYPOINT [ "/start.sh" ] diff --git a/src/pgImage/Makefile b/src/pgImage/Makefile deleted file mode 100644 index c61110f..0000000 --- a/src/pgImage/Makefile +++ /dev/null @@ -1,38 +0,0 @@ -include ../vars.mk -service = expenses-pgdb -image = $(service) -container = $(image)-container - -.PHONY: clean attach-test test - -clean: - @docker image inspect $(image) > /dev/null 2>&1 && \ - docker image rm $(image) || true - -build: - cp ../expenses/repo/pgdb/schema.sql . - docker buildx build \ - -t $(registry)/$(repo)/expensesdb:$(tag) . - -push_image: - docker push $(registry)/$(repo)/expensesdb:$(tag) - -attach: - docker exec -it $(container) zsh - -attach-test: - docker exec -it $(container)-dev zsh - -remove-dev-container: - docker container rm $(container)-dev --force > /dev/null 2>&1 - -test: remove-dev-container - docker run -p 5431:5432 \ - --name $(container)-dev \ - --env-file .env \ - -v ./pgsql-data-dev/:/var/lib/postgresql/data/ \ - -v ./pgSocket:/run/postgresql \ - -it $(registry)/$(repo)/expensesdb:v0.0.91-alpha - -build_image: - make -C ./ diff --git a/src/pgImage/README.md b/src/pgImage/README.md deleted file mode 100644 index 98596f1..0000000 --- a/src/pgImage/README.md +++ /dev/null @@ -1,9 +0,0 @@ -# README - -Requires a `.env` file with the following fields: -``` -PGDATA= -ExpDB_USER= -ExpDB_PASS= -ExpDB_NAME= -``` diff --git a/src/pgImage/expenses_pg_2025-09-06_00:16:43.bak b/src/pgImage/expenses_pg_2025-09-06_00:16:43.bak deleted file mode 100644 index 69f7052..0000000 --- a/src/pgImage/expenses_pg_2025-09-06_00:16:43.bak +++ /dev/null @@ -1,1043 +0,0 @@ --- --- PostgreSQL database dump --- - -\restrict YD6WOUPNPjmsw55mlY0y3tJ8W2L6YjUXHMPUkdckfUq4elWGHIrGHkeyf7x1D0N - --- Dumped from database version 16.10 --- Dumped by pg_dump version 16.10 - -SET statement_timeout = 0; -SET lock_timeout = 0; -SET idle_in_transaction_session_timeout = 0; -SET client_encoding = 'UTF8'; -SET standard_conforming_strings = on; -SELECT pg_catalog.set_config('search_path', '', false); -SET check_function_bodies = false; -SET xmloption = content; -SET client_min_messages = warning; -SET row_security = off; - --- --- Data for Name: categories; Type: TABLE DATA; Schema: public; Owner: expdbuser --- - -COPY public.categories ("CategoryID", "CategoryName") FROM stdin; -0 No Category -1 Forester -2 Starlet -3 Restaurant -4 Tools -5 Hardware -6 Recibo -7 Finanças -8 Casa -9 Karting -10 3DP -11 Server -12 Renda -13 Groceries -14 Electricity -15 Simracing -16 Internet -17 Hotels -18 Entretenimento -19 Investements -20 Prenda -21 Tap Water -22 Office -25 Health -\. - - --- --- Data for Name: expenseTypes; Type: TABLE DATA; Schema: public; Owner: expdbuser --- - -COPY public."expenseTypes" ("TypeID", "TypeName") FROM stdin; -0 Despesa -1 Salário -2 Cartão Refeição -3 Reembolso -4 Prenda -5 Investment -\. - - --- --- Data for Name: stores; Type: TABLE DATA; Schema: public; Owner: expdbuser --- - -COPY public.stores ("StoreID", "StoreName") FROM stdin; -0 No Store -1 Velocix -2 Estado -3 Borges e Almeida -4 Kartódromo Viana -5 Cabo do Mundo -6 Kartcenter Matosinhos -7 Decathlon -8 Landlord -9 Nortenha -10 Via Verde -11 Galp -12 Endesa -13 Evolt -14 iRacing -15 UZO -16 Aliexpress -17 Sportzone -18 OLX -19 Norauto -20 Prio -21 BP -22 Cinemax -23 Degiro -24 Leroy Merlin -25 About You -26 BK -27 Pasta e Basta -28 Penafiel Verde -29 Continente -30 Mercadona -31 Auto Irmãos Ferreira -32 Note -33 Subarak -34 Escape6 -35 Tranquilidade -36 LIDL -37 OZ Energia -38 Q8 -39 Prio -40 La Trattoria Di -41 IKEA -42 Hugo Atlantis -43 Wells -44 Gumroad -45 Inovpeças -\. - - --- --- Data for Name: users; Type: TABLE DATA; Schema: public; Owner: expdbuser --- - -COPY public.users ("UserID", "UserName", "UserPass") FROM stdin; -1 esilva $2y$10$P1sAIsnyD6byXzwPaXay9uP8Rmddz9BQkjl0fiEDHSktzj4ATyrfK -2 kika $2y$10$P1sAIsnyD6byXzwPaXay9uP8Rmddz9BQkjl0fiEDHSktzj4ATyrfK -\. - - --- --- Data for Name: expenses; Type: TABLE DATA; Schema: public; Owner: expdbuser --- - -COPY public.expenses ("ExpID", "Description", "Value", "StoreID", "CategoryID", "OwnerUserID", "TypeID", "ExpDate", "CreationDate", "PaidOff", "SharesEven") FROM stdin; -1 Oil 93.47 0 0 1 0 2025-01-02 00:00:00 2025-07-21 00:00:00 t t -2 Karting 32.00 5 9 1 0 2025-01-02 00:00:00 2025-07-21 00:00:00 t t -3 Dinner 9.98 26 3 1 0 2025-01-02 00:00:00 2025-07-21 00:00:00 t t -4 LPG 40.43 0 1 1 0 2025-01-02 00:00:00 2025-07-21 00:00:00 t t -5 Anti-Fog 11.00 0 9 1 0 2025-01-02 00:00:00 2025-07-21 00:00:00 t t -6 Decathlon 5.90 0 0 1 0 2025-01-03 00:00:00 2025-07-21 00:00:00 t t -7 Casaco Impermeável 19.99 17 9 1 0 2025-01-03 00:00:00 2025-07-21 00:00:00 t t -8 Water 14.00 0 13 1 0 2025-01-04 00:00:00 2025-07-21 00:00:00 t t -9 Lunch 12.62 0 3 1 0 2025-01-04 00:00:00 2025-07-21 00:00:00 t t -10 GoPro 230.00 18 9 1 0 2025-01-04 00:00:00 2025-07-21 00:00:00 t t -11 LPG 45.39 0 1 1 0 2025-01-09 00:00:00 2025-07-21 00:00:00 t t -12 Groceries 197.99 0 13 1 0 2025-01-10 00:00:00 2025-07-21 00:00:00 t t -13 Internet Janeiro 2025 35.00 15 16 1 0 2025-01-10 00:00:00 2025-07-21 00:00:00 t t -14 Karting 32.00 5 9 1 0 2025-01-12 00:00:00 2025-07-21 00:00:00 t t -15 Petrol 64.45 0 0 1 0 2025-01-12 00:00:00 2025-07-21 00:00:00 t t -16 AutoDetailing 163.08 0 0 1 0 2025-01-16 00:00:00 2025-07-21 00:00:00 t t -17 Parking 10.50 0 0 1 0 2025-01-21 00:00:00 2025-07-21 00:00:00 t t -18 Luz Janeiro 2025 133.15 12 14 1 0 2025-01-22 00:00:00 2025-07-21 00:00:00 t t -19 Forester 9.84 0 0 1 0 2025-01-22 00:00:00 2025-07-21 00:00:00 t t -20 LPG 38.72 0 1 1 0 2025-01-22 00:00:00 2025-07-21 00:00:00 t t -21 Parking 7.20 0 0 1 0 2025-01-23 00:00:00 2025-07-21 00:00:00 t t -22 Hardware 5.52 0 0 1 0 2025-01-23 00:00:00 2025-07-21 00:00:00 t t -23 Forester 7.95 0 0 1 0 2025-01-23 00:00:00 2025-07-21 00:00:00 t t -24 Renda Janeiro 2025 450.00 8 12 1 0 2025-01-24 00:00:00 2025-07-21 00:00:00 t t -25 Parking 10.50 0 0 1 0 2025-01-27 00:00:00 2025-07-21 00:00:00 t t -26 Petrol 73.38 0 0 1 0 2025-01-27 00:00:00 2025-07-21 00:00:00 t t -27 Hotel SKO 2025 14.00 0 17 1 0 2025-01-28 00:00:00 2025-07-21 00:00:00 t t -28 LPG 41.31 0 1 1 0 2025-01-28 00:00:00 2025-07-21 00:00:00 t t -29 Salary 1769.64 1 6 1 1 2025-01-29 00:00:00 2025-07-21 00:00:00 t t -30 Parking 15.00 0 0 1 0 2025-01-29 00:00:00 2025-07-21 00:00:00 t t -31 LPG 45.40 0 1 1 0 2025-01-29 00:00:00 2025-07-21 00:00:00 t t -32 Dinner 20.49 0 0 1 0 2025-01-29 00:00:00 2025-07-21 00:00:00 t t -33 Cartão Refeição 165.00 1 6 1 2 2025-01-29 00:00:00 2025-07-21 00:00:00 t t -34 Calças/casaco impermeável 38.50 7 9 1 0 2025-01-31 00:00:00 2025-07-21 00:00:00 t t -35 Forester 32.73 0 0 1 0 2025-01-31 00:00:00 2025-07-21 00:00:00 t t -36 Forester 49.20 0 0 1 0 2025-01-31 00:00:00 2025-07-21 00:00:00 t t -37 Petrol 59.09 0 0 1 0 2025-01-31 00:00:00 2025-07-21 00:00:00 t t -38 Legal 50.00 0 0 1 0 2025-01-31 00:00:00 2025-07-21 00:00:00 t t -39 Breakfast 6.00 0 0 1 0 2025-01-31 00:00:00 2025-07-21 00:00:00 t t -40 ViaVerde 44.25 0 0 1 0 2025-01-31 00:00:00 2025-07-21 00:00:00 t t -41 Ikea 12.98 0 0 1 0 2025-02-01 00:00:00 2025-07-21 00:00:00 t t -42 Lunch 18.20 0 0 1 0 2025-02-01 00:00:00 2025-07-21 00:00:00 t t -43 Karting 25.00 0 0 1 0 2025-02-01 00:00:00 2025-07-21 00:00:00 t t -44 Water 17.51 0 0 1 0 2025-02-04 00:00:00 2025-07-21 00:00:00 t t -45 Forester 316.45 0 0 1 0 2025-02-05 00:00:00 2025-07-21 00:00:00 t t -46 Groceries 232.55 0 0 1 0 2025-02-05 00:00:00 2025-07-21 00:00:00 t t -47 Dinner 9.98 0 0 1 0 2025-02-06 00:00:00 2025-07-21 00:00:00 t t -48 Forester 68.57 0 0 1 0 2025-02-06 00:00:00 2025-07-21 00:00:00 t t -49 Karting 49.00 0 0 1 0 2025-02-08 00:00:00 2025-07-21 00:00:00 t t -50 Lunch 31.00 0 0 1 0 2025-02-08 00:00:00 2025-07-21 00:00:00 t t -51 Tools 14.99 0 0 1 0 2025-02-10 00:00:00 2025-07-21 00:00:00 t t -52 Hardware 21.07 0 0 1 0 2025-02-10 00:00:00 2025-07-21 00:00:00 t t -53 Petrol 84.66 0 0 1 0 2025-02-10 00:00:00 2025-07-21 00:00:00 t t -54 Tools 5.00 0 0 1 0 2025-02-12 00:00:00 2025-07-21 00:00:00 t t -55 Hardawre 27.95 0 0 1 0 2025-02-12 00:00:00 2025-07-21 00:00:00 t t -56 Hardaware 7.95 0 0 1 0 2025-02-13 00:00:00 2025-07-21 00:00:00 t t -57 Karting 50.00 0 0 1 0 2025-02-14 00:00:00 2025-07-21 00:00:00 t t -58 Tools 136.97 0 0 1 0 2025-02-14 00:00:00 2025-07-21 00:00:00 t t -59 Hardware 17.85 0 0 1 0 2025-02-16 00:00:00 2025-07-21 00:00:00 t t -60 Hardware 36.90 0 0 1 0 2025-02-17 00:00:00 2025-07-21 00:00:00 t t -61 Renda Fevereiro 2025 450.00 8 12 1 0 2025-02-18 00:00:00 2025-07-21 00:00:00 t t -62 Forester 104.00 0 0 1 0 2025-02-19 00:00:00 2025-07-21 00:00:00 t t -63 Starlet 63.55 0 0 1 0 2025-02-20 00:00:00 2025-07-21 00:00:00 t t -64 Hardware 19.95 0 0 1 0 2025-02-20 00:00:00 2025-07-21 00:00:00 t t -65 Brake Fluid 17.97 0 0 1 0 2025-02-20 00:00:00 2025-07-21 00:00:00 t t -66 Endesa 148.05 12 14 1 0 2025-02-21 00:00:00 2025-07-21 00:00:00 t t -67 Tools 23.43 0 0 1 0 2025-02-21 00:00:00 2025-07-21 00:00:00 t t -68 Karting 32.00 0 0 1 0 2025-02-22 00:00:00 2025-07-21 00:00:00 t t -69 Petrol 57.23 0 0 1 0 2025-02-22 00:00:00 2025-07-21 00:00:00 t t -70 Dinner 70.70 0 0 1 0 2025-02-25 00:00:00 2025-07-21 00:00:00 t t -71 Salary 1867.06 1 6 1 1 2025-02-27 00:00:00 2025-07-21 00:00:00 t t -72 Cartão Refeição 150.00 1 6 1 2 2025-02-27 00:00:00 2025-07-21 00:00:00 t t -73 Parking 8.40 0 0 1 0 2025-02-28 00:00:00 2025-07-21 00:00:00 t t -74 ViaVerde 28.65 0 0 1 0 2025-02-28 00:00:00 2025-07-21 00:00:00 t t -75 Petrol 73.00 0 1 1 0 2025-03-01 00:00:00 2025-07-21 00:00:00 t t -76 Lunch 12.62 0 0 1 0 2025-03-01 00:00:00 2025-07-21 00:00:00 t t -77 Endesa 78.90 12 14 1 0 2025-03-03 00:00:00 2025-07-21 00:00:00 t t -78 Groceries 233.00 0 0 1 0 2025-03-05 00:00:00 2025-07-21 00:00:00 t t -79 Water 14.60 0 0 1 0 2025-03-05 00:00:00 2025-07-21 00:00:00 t t -80 Forester 70.00 0 0 1 0 2025-03-07 00:00:00 2025-07-21 00:00:00 t t -81 Breakfast 5.70 0 0 1 0 2025-03-07 00:00:00 2025-07-21 00:00:00 t t -82 iRacing 39.64 0 0 1 0 2025-03-12 00:00:00 2025-07-21 00:00:00 t t -83 Internet 35.00 15 16 1 0 2025-03-12 00:00:00 2025-07-21 00:00:00 t t -84 Petrol 30.47 0 0 1 0 2025-03-15 00:00:00 2025-07-21 00:00:00 t t -85 Lunch 15.75 0 0 1 0 2025-03-15 00:00:00 2025-07-21 00:00:00 t t -86 Karting 40.00 0 0 1 0 2025-03-16 00:00:00 2025-07-21 00:00:00 t t -87 Starletu 29.85 0 0 1 0 2025-03-16 00:00:00 2025-07-21 00:00:00 t t -88 Petrol 47.12 0 0 1 0 2025-03-16 00:00:00 2025-07-21 00:00:00 t t -89 Starlet 10.00 0 0 1 0 2025-03-20 00:00:00 2025-07-21 00:00:00 t t -90 Starlet 81.01 0 0 1 0 2025-03-20 00:00:00 2025-07-21 00:00:00 t t -91 Galp 31.10 0 0 1 0 2025-03-21 00:00:00 2025-07-21 00:00:00 t t -92 Rent 450.00 0 0 1 0 2025-03-21 00:00:00 2025-07-21 00:00:00 t t -93 Starlet 105.74 0 0 1 0 2025-03-24 00:00:00 2025-07-21 00:00:00 t t -94 Karting 50.00 0 0 1 0 2025-03-24 00:00:00 2025-07-21 00:00:00 t t -95 Lunch 15.75 0 0 1 0 2025-03-27 00:00:00 2025-07-21 00:00:00 t t -96 Cartão Refeição 157.50 1 0 1 2 2025-03-27 00:00:00 2025-07-21 00:00:00 t t -97 Salary 3077.19 1 6 1 1 2025-03-28 00:00:00 2025-07-21 00:00:00 t t -98 Hardware 67.50 0 0 1 0 2025-03-29 00:00:00 2025-07-21 00:00:00 t t -99 Lunch 10.98 0 0 1 0 2025-03-29 00:00:00 2025-07-21 00:00:00 t t -100 Starlet 145.00 0 0 1 0 2025-03-29 00:00:00 2025-07-21 00:00:00 t t -101 Karting 40.00 0 0 1 0 2025-03-30 00:00:00 2025-07-21 00:00:00 t t -102 Petrol 40.95 0 0 1 0 2025-03-30 00:00:00 2025-07-21 00:00:00 t t -103 ViaVerde 31.99 0 0 1 0 2025-03-31 00:00:00 2025-07-21 00:00:00 t t -104 Groceries 245.97 0 0 1 0 2025-04-02 00:00:00 2025-07-21 00:00:00 t t -105 Hardware 27.00 0 0 1 0 2025-04-03 00:00:00 2025-07-21 00:00:00 t t -106 Water 12.90 0 0 1 0 2025-04-03 00:00:00 2025-07-21 00:00:00 t t -107 Petrol 26.30 0 0 1 0 2025-04-04 00:00:00 2025-07-21 00:00:00 t t -108 Lunch 34.00 0 0 1 0 2025-04-05 00:00:00 2025-07-21 00:00:00 t t -109 Glasses 199.00 0 0 1 0 2025-04-08 00:00:00 2025-07-21 00:00:00 t t -110 Petrol 43.70 0 0 1 0 2025-04-13 00:00:00 2025-07-21 00:00:00 t t -111 IRS 1370.64 2 7 1 3 2025-04-14 00:00:00 2025-07-21 00:00:00 t t -112 Battery 34.75 0 0 1 0 2025-04-14 00:00:00 2025-07-21 00:00:00 t t -113 Dinner 11.82 0 3 1 0 2025-04-14 00:00:00 2025-07-21 00:00:00 t t -114 Karting 32.00 0 0 1 0 2025-04-16 00:00:00 2025-07-21 00:00:00 t t -115 Karting 50.00 0 0 1 0 2025-04-17 00:00:00 2025-07-21 00:00:00 t t -116 Parking 24.90 0 0 1 0 2025-04-17 00:00:00 2025-07-21 00:00:00 t t -117 Petrol 46.64 0 0 1 0 2025-04-19 00:00:00 2025-07-21 00:00:00 t t -118 Galp 96.89 0 0 1 0 2025-04-21 00:00:00 2025-07-21 00:00:00 t t -119 Pharmacy 9.94 0 0 1 0 2025-04-23 00:00:00 2025-07-21 00:00:00 t t -120 Rent 480.00 0 0 1 0 2025-04-24 00:00:00 2025-07-21 00:00:00 t t -121 Karting 50.00 0 0 1 0 2025-04-24 00:00:00 2025-07-21 00:00:00 t t -122 Groceries 17.06 0 0 1 0 2025-04-24 00:00:00 2025-07-21 00:00:00 t t -123 Office Supplies 75.20 0 0 1 0 2025-04-24 00:00:00 2025-07-21 00:00:00 t t -124 Lunch 13.90 0 0 1 0 2025-04-25 00:00:00 2025-07-21 00:00:00 t t -125 Petrol 48.06 0 0 1 0 2025-04-29 00:00:00 2025-07-21 00:00:00 t t -126 Salary 1710.81 1 6 1 1 2025-04-29 00:00:00 2025-07-21 00:00:00 t t -127 Cartão Refeição 150.00 1 6 1 2 2025-04-29 00:00:00 2025-07-21 00:00:00 t t -128 Starlet 36.64 0 0 1 0 2025-04-30 00:00:00 2025-07-21 00:00:00 t t -129 Groceries 122.99 0 0 1 0 2025-04-30 00:00:00 2025-07-21 00:00:00 t t -130 ViaVerde 31.69 0 0 1 0 2025-04-30 00:00:00 2025-07-21 00:00:00 t t -131 Reimbursment – Kika 398.63 0 8 1 3 2025-05-01 00:00:00 2025-07-21 00:00:00 t t -132 Fidelidade 357.75 0 0 1 0 2025-05-02 00:00:00 2025-07-21 00:00:00 t t -133 UAB 162.50 0 0 1 0 2025-05-05 00:00:00 2025-07-21 00:00:00 t t -134 PTServidor 12.00 0 0 1 0 2025-05-12 00:00:00 2025-07-21 00:00:00 t t -135 Internet Maio 2025 23.76 15 16 1 0 2025-05-14 00:00:00 2025-07-21 00:00:00 t t -136 Water 15.94 0 0 1 0 2025-05-15 00:00:00 2025-07-21 00:00:00 t t -137 Petrol 43.74 0 0 1 0 2025-05-15 00:00:00 2025-07-21 00:00:00 t t -138 karting 40.00 0 0 1 0 2025-05-16 00:00:00 2025-07-21 00:00:00 t t -139 Petrol 45.25 0 0 1 0 2025-05-17 00:00:00 2025-07-21 00:00:00 t t -140 Festa da Terra 10.00 0 0 1 0 2025-05-19 00:00:00 2025-07-21 00:00:00 t t -141 Rent 480.00 0 0 1 0 2025-05-20 00:00:00 2025-07-21 00:00:00 t t -142 Galp 87.65 0 0 1 0 2025-05-20 00:00:00 2025-07-21 00:00:00 t t -143 Server 118.49 0 0 1 0 2025-05-20 00:00:00 2025-07-21 00:00:00 t t -144 Groceries 4.77 0 0 1 0 2025-05-22 00:00:00 2025-07-21 00:00:00 t t -145 Groceries 11.08 0 0 1 0 2025-05-24 00:00:00 2025-07-21 00:00:00 t t -146 IUC 12.55 2 2 1 0 2025-05-26 00:00:00 2025-07-21 00:00:00 t t -147 Filamentos 53.43 13 10 1 0 2025-05-26 00:00:00 2025-07-21 00:00:00 t t -148 Salary 1832.91 1 6 1 1 2025-05-29 00:00:00 2025-07-21 00:00:00 t t -149 Cartão Refeição 157.50 1 6 1 2 2025-05-30 00:00:00 2025-07-21 00:00:00 t t -150 ViaVerde 40.33 0 0 1 0 2025-05-31 00:00:00 2025-07-21 00:00:00 t t -151 iRacing - Car 13.00 14 15 1 0 2025-06-01 00:00:00 2025-07-21 00:00:00 t t -152 Reimbursment – Kika 641.11 0 8 1 3 2025-06-02 00:00:00 2025-07-21 00:00:00 t t -153 Server 388.82 0 0 1 0 2025-06-02 00:00:00 2025-07-21 00:00:00 t t -154 Petrol 40.96 0 0 1 0 2025-06-02 00:00:00 2025-07-21 00:00:00 t t -155 Groceries 20.52 0 0 1 0 2025-06-03 00:00:00 2025-07-21 00:00:00 t t -156 Karting - CMC 50.00 5 9 1 0 2025-06-04 00:00:00 2025-07-21 00:00:00 t t -157 Kitchen 13.00 0 0 1 0 2025-06-04 00:00:00 2025-07-21 00:00:00 t t -158 Forester 1200.00 0 0 1 0 2025-06-05 00:00:00 2025-07-21 00:00:00 t t -159 Domain 22.90 0 11 1 0 2025-06-07 00:00:00 2025-07-21 00:00:00 t t -160 Hostinger 129.56 0 11 1 0 2025-06-07 00:00:00 2025-07-21 00:00:00 t t -161 Petrol 47.78 0 0 1 0 2025-06-07 00:00:00 2025-07-21 00:00:00 t t -162 Water 14.60 0 0 1 0 2025-06-10 00:00:00 2025-07-21 00:00:00 t t -163 Internet Junho 2025 23.00 15 16 1 0 2025-06-11 00:00:00 2025-07-21 00:00:00 t t -164 Mobo Z370M Servidor 76.14 16 11 1 0 2025-06-16 00:00:00 2025-07-21 00:00:00 t t -165 Luz Junho 2025 68.26 11 14 1 0 2025-06-23 00:00:00 2025-07-21 00:00:00 t t -166 Renda Junho 2025 480.00 8 12 1 0 2025-06-25 00:00:00 2025-07-21 00:00:00 t t -167 Petrol 31.36 0 2 1 0 2025-06-25 00:00:00 2025-07-21 00:00:00 t t -168 Salário Jun 2025 1710.81 1 6 1 1 2025-06-27 00:00:00 2025-07-21 00:00:00 t t -169 Cartão Refeição 135.00 1 6 1 2 2025-06-27 00:00:00 2025-07-21 00:00:00 t t -170 Petrol 34.56 0 2 1 0 2025-06-30 00:00:00 2025-07-21 00:00:00 t t -171 Petrol 47.50 0 2 1 0 2025-07-01 00:00:00 2025-07-21 00:00:00 t t -172 Starlet 20.00 0 0 1 0 2025-07-01 00:00:00 2025-07-21 00:00:00 t t -173 Petrol 78.95 0 1 1 0 2025-07-02 00:00:00 2025-07-21 00:00:00 t t -174 Forester 1300.00 3 1 1 0 2025-07-02 00:00:00 2025-07-21 00:00:00 t t -175 Starlet Problemas Ignição 120.00 3 2 1 0 2025-07-02 00:00:00 2025-07-21 00:00:00 t t -176 Forester 729.51 9 1 1 0 2025-07-02 00:00:00 2025-07-21 00:00:00 t t -178 Reimbursment – Kika 989.95 0 8 1 3 2025-07-03 00:00:00 2025-07-21 00:00:00 t t -179 Dinner 19.60 0 3 1 0 2025-07-03 00:00:00 2025-07-21 00:00:00 t t -180 Água Junho 2025 16.82 28 21 1 0 2025-07-07 00:00:00 2025-07-21 00:00:00 t t -181 Renda Julho 2025 480.00 8 12 1 0 2025-07-10 00:00:00 2025-07-21 00:00:00 t t -182 Petrol 86.38 0 1 1 0 2025-07-08 00:00:00 2025-07-21 00:00:00 t t -183 Dinner 16.00 0 3 1 0 2025-07-10 00:00:00 2025-07-21 00:00:00 t t -184 Forester 94.88 33 1 1 0 2025-07-11 00:00:00 2025-07-21 00:00:00 t t -185 Forester 57.47 34 1 1 0 2025-07-12 00:00:00 2025-07-21 00:00:00 t t -186 Medidor Pressão Pneus 14.99 19 4 1 0 2025-07-19 00:00:00 1970-01-01 00:00:00 t t -187 Petrol Forester 80.00 20 1 1 0 2025-07-17 00:00:00 1970-01-01 00:00:00 t t -188 Petrol Forester 81.16 21 1 1 0 2025-07-14 00:00:00 1970-01-01 00:00:00 t t -189 Snacks e Molas 13.75 0 8 1 0 2025-07-12 00:00:00 1970-01-01 00:00:00 t t -190 Cinema - F1 22.55 22 18 1 0 2025-07-17 00:00:00 1970-01-01 00:00:00 t t -191 ETF 391.00 23 19 1 5 2025-07-15 00:00:00 1970-01-01 00:00:00 t t -192 Peças Mangueira 7.49 24 5 1 0 2025-07-14 00:00:00 1970-01-01 00:00:00 t t -193 Sapatos Castanhos Kika 89.90 25 20 1 0 2025-07-12 00:00:00 1970-01-01 00:00:00 t t -194 Pizza 13.50 27 3 1 0 2025-07-19 00:00:00 1970-01-01 00:00:00 t t -195 Lunch 19.94 26 3 1 0 2025-07-19 00:00:00 1970-01-01 00:00:00 t t -196 Continente 97.08 29 13 1 0 2025-07-02 00:00:00 1970-01-01 00:00:00 t t -197 Mercadona 141.94 30 13 1 0 2025-07-02 00:00:00 1970-01-01 00:00:00 t t -198 Revisão LPG Forester 125.56 31 1 1 0 2025-07-23 00:00:00 2025-07-23 00:00:00 t t -199 LGP Forester 33.89 31 1 1 0 2025-07-23 00:00:00 2025-07-23 00:00:00 t t -200 Groceries 19.38 29 13 1 0 2025-07-23 00:00:00 2025-07-25 00:00:00 t t -201 Notebook 11.88 32 22 1 0 2025-07-24 00:00:00 2025-07-25 00:00:00 t t -202 Cooling Sys Stuff 76.77 3 2 1 0 2025-07-18 00:00:00 2025-07-25 00:00:00 t t -203 Seguro Starlet 81.47 35 2 1 0 2025-07-16 00:00:00 2025-07-25 00:00:00 t t -204 Prenda Avó 10.00 0 20 1 4 2025-07-24 00:00:00 2025-07-25 00:00:00 t t -205 Prenda Mãe 60.00 0 20 1 4 2025-07-24 00:00:00 2025-07-25 00:00:00 t t -206 Internet Julho 2025 23.00 15 16 1 0 2025-07-09 00:00:00 2025-07-25 00:00:00 t t -207 Luz Julho 2025 79.87 11 14 1 0 2025-07-21 00:00:00 2025-07-25 00:00:00 t t -209 Salário Jul 2025 3410.62 0 6 1 1 2025-07-30 00:00:00 2025-07-30 00:00:00 t t -210 CRefeição Jul 2025 172.25 0 6 1 2 2025-07-30 00:00:00 2025-07-30 00:00:00 f f -211 Groceries Mercadona 119.45 30 13 1 0 2025-07-31 00:00:00 2025-07-31 00:00:00 t t -212 Groceries Continente 121.81 29 13 1 0 2025-07-31 00:00:00 2025-07-31 00:00:00 t t -213 Reimb. - Torres Vedras 91.35 0 0 1 3 2025-07-31 00:00:00 2025-07-31 00:00:00 t t -214 iRacing - Porsche GT3 12.77 14 15 1 0 2025-07-30 00:00:00 2025-08-01 00:00:00 t t -215 ETF 2175.00 23 19 1 5 2025-07-30 00:00:00 2025-08-01 00:00:00 t t -216 ETF 1000.00 23 19 1 5 2025-08-01 00:00:00 2025-08-01 00:00:00 t t -217 Alicates 51.45 36 4 1 0 2025-07-31 00:00:00 2025-08-01 00:00:00 t t -218 Petrol 50.00 39 1 1 0 2025-07-29 00:00:00 2025-08-01 00:00:00 t t -219 LPG 34.93 37 1 1 0 2025-07-29 00:00:00 2025-08-01 00:00:00 t t -220 Dinner AMI 16.60 40 3 1 0 2025-08-07 00:00:00 2025-08-08 00:00:00 t t -221 Internet Aug 2025 23.00 15 16 1 0 2025-08-08 00:00:00 2025-08-08 00:00:00 t t -222 Armário Escritório 260.00 41 8 1 0 2025-08-05 00:00:00 2025-08-08 00:00:00 t t -223 LPG Fozzie 30.08 37 1 1 0 2025-08-07 00:00:00 2025-08-08 00:00:00 t t -224 Dinner 14.10 41 3 1 0 2025-08-05 00:00:00 2025-08-08 00:00:00 t t -225 Água Julho 2025 17.49 28 21 1 0 2025-08-11 00:00:00 2025-08-09 00:00:00 t t -226 Stereo Starlet 124.00 19 2 1 0 2025-07-29 00:00:00 2025-08-10 00:00:00 t t -227 Petrol 46.28 39 2 1 0 2025-08-02 00:00:00 2025-08-18 00:00:00 t t -228 Florester 250.80 42 1 1 0 2025-08-22 00:00:00 2025-08-22 00:00:00 t t -229 Glasses 108.10 43 25 1 0 2025-08-21 00:00:00 2025-08-22 00:00:00 t t -230 Dinner AMI 19.85 40 3 1 0 2025-08-21 00:00:00 2025-08-22 00:00:00 t t -231 Luz Aug 2025 88.91 11 14 1 0 2025-08-18 00:00:00 2025-08-22 00:00:00 t t -232 Beamng Cars 10.89 44 15 1 0 2025-08-21 00:00:00 2025-08-22 00:00:00 t t -233 Groceries 34.01 29 13 1 0 2025-08-20 00:00:00 2025-08-22 00:00:00 t t -234 Rent Aug 2025 480.00 8 12 1 0 2025-08-22 00:00:00 2025-08-22 00:00:00 t t -235 Óleo DA 12.85 45 1 1 0 2025-08-25 00:00:00 2025-08-27 00:00:00 t t -236 Salário Aug 2025 1798.81 1 6 1 1 2025-08-28 00:00:00 2025-08-28 00:00:00 t t -237 CRefeição Aug 2025 150.00 1 6 1 2 2025-08-28 00:00:00 2025-08-28 00:00:00 t t -238 Degiro ETF 535.00 23 19 1 0 2025-08-29 00:00:00 2025-08-29 00:00:00 t f -240 Petrol Starlet 46.67 38 2 1 0 2025-08-28 00:00:00 2025-08-31 00:00:00 t f -241 Dinner AMI 13.00 0 3 1 0 2025-08-28 00:00:00 2025-08-31 00:00:00 t f -242 Degiro ETF 965.00 23 19 1 0 2025-09-01 00:00:00 2025-09-01 00:00:00 t f -243 Água Agosto 2025 14.93 28 21 1 0 2025-09-03 00:00:00 2025-09-03 15:05:34.566841 t f -244 Luz Sep 2025 108.03 11 14 1 0 2025-09-18 00:00:00 2025-09-03 15:18:59.046393 t f -245 Dinner AMI 13.40 0 3 1 0 2025-09-04 00:00:00 2025-09-05 10:37:35.120408 t f -\. - - --- --- Data for Name: expensesPayments; Type: TABLE DATA; Schema: public; Owner: expdbuser --- - -COPY public."expensesPayments" ("ExpPaymID", "ExpID", "UserID", "Payed") FROM stdin; -1 1 1 93.47 -2 2 1 32.00 -3 3 1 9.98 -4 4 1 40.43 -5 5 1 11.00 -6 6 1 5.90 -7 7 1 19.99 -8 8 1 7.00 -9 8 2 7.00 -10 9 1 12.62 -11 10 1 230.00 -12 11 1 45.39 -13 12 1 99.00 -14 12 2 98.99 -15 13 1 17.50 -16 13 2 17.50 -17 14 1 32.00 -18 15 1 64.45 -19 16 1 163.08 -20 17 1 10.50 -21 18 1 66.58 -22 18 2 66.57 -23 19 1 9.84 -24 20 1 38.72 -25 21 1 7.20 -26 22 1 5.52 -27 23 1 7.95 -28 24 1 225.00 -29 24 2 225.00 -30 25 1 10.50 -31 26 1 73.38 -32 27 1 14.00 -33 28 1 41.31 -34 29 1 1769.64 -35 30 1 15.00 -36 31 1 45.40 -37 32 1 20.49 -38 33 1 165.00 -39 34 1 38.50 -40 35 1 32.73 -41 36 1 49.20 -42 37 1 59.09 -43 38 1 50.00 -44 39 1 6.00 -45 40 1 44.25 -46 41 1 12.98 -47 42 1 18.20 -48 43 1 25.00 -49 44 1 8.76 -50 44 2 8.75 -51 45 1 316.45 -52 46 1 116.28 -53 46 2 116.27 -54 47 1 9.98 -55 48 1 68.57 -56 49 1 49.00 -57 50 1 31.00 -58 51 1 14.99 -59 52 1 21.07 -60 53 1 84.66 -61 54 1 5.00 -62 55 1 27.95 -63 56 1 7.95 -64 57 1 50.00 -65 58 1 136.97 -66 59 1 17.85 -67 60 1 36.90 -68 61 1 225.00 -69 61 2 225.00 -70 62 1 104.00 -71 63 1 63.55 -72 64 1 19.95 -73 65 1 17.97 -74 66 1 74.03 -75 66 2 74.02 -76 67 1 23.43 -77 68 1 32.00 -78 69 1 57.23 -79 70 1 70.70 -80 71 1 1867.06 -81 72 1 150.00 -82 73 1 8.40 -83 74 1 28.65 -84 75 1 73.00 -85 76 1 12.62 -86 77 1 39.45 -87 77 2 39.45 -88 78 1 116.50 -89 78 2 116.50 -90 79 1 7.30 -91 79 2 7.30 -92 80 1 70.00 -93 81 1 5.70 -94 82 1 39.64 -95 83 1 17.50 -96 83 2 17.50 -97 84 1 30.47 -98 85 1 15.75 -99 86 1 40.00 -100 87 1 29.85 -101 88 1 47.12 -102 89 1 10.00 -103 90 1 81.01 -104 91 1 15.55 -105 91 2 15.55 -106 92 1 225.00 -107 92 2 225.00 -108 93 1 105.74 -109 94 1 50.00 -110 95 1 15.75 -111 96 1 157.50 -112 97 1 3077.19 -113 98 1 67.50 -114 99 1 10.98 -115 100 1 145.00 -116 101 1 40.00 -117 102 1 40.95 -118 103 1 31.99 -119 104 1 122.99 -120 104 2 122.98 -121 105 1 27.00 -122 106 1 6.45 -123 106 2 6.45 -124 107 1 26.30 -125 108 1 34.00 -126 109 1 199.00 -127 110 1 43.70 -128 111 1 1370.64 -129 112 1 34.75 -130 113 1 11.82 -131 114 1 32.00 -132 115 1 50.00 -133 116 1 24.90 -134 117 1 46.64 -135 118 1 48.45 -136 118 2 48.44 -137 119 1 9.94 -138 120 1 240.00 -139 120 2 240.00 -140 121 1 50.00 -141 122 1 8.53 -142 122 2 8.53 -143 123 1 75.20 -144 124 1 13.90 -145 125 1 48.06 -146 126 1 1710.81 -147 127 1 150.00 -148 128 1 36.64 -149 129 1 61.50 -150 129 2 61.49 -151 130 1 31.69 -152 131 2 398.63 -153 132 1 357.75 -154 133 1 162.50 -155 134 1 12.00 -156 135 1 11.88 -157 135 2 11.88 -158 136 1 7.97 -159 136 2 7.97 -160 137 1 43.74 -161 138 1 40.00 -162 139 1 45.25 -163 140 1 10.00 -164 141 1 240.00 -165 141 2 240.00 -166 142 1 43.83 -167 142 2 43.82 -168 143 1 118.49 -169 144 1 4.77 -170 145 1 11.08 -171 146 1 12.55 -172 147 1 53.43 -173 148 1 1832.91 -174 149 1 157.50 -175 150 1 40.33 -176 151 1 13.00 -177 152 2 641.11 -178 153 1 388.82 -179 154 1 40.96 -180 155 1 10.26 -181 155 2 10.26 -182 156 1 50.00 -183 157 1 13.00 -184 158 1 1200.00 -185 159 1 22.90 -186 160 1 129.56 -187 161 1 47.78 -188 162 1 7.30 -189 162 2 7.30 -190 163 1 11.50 -191 163 2 11.50 -192 164 1 76.14 -193 165 1 34.13 -194 165 2 34.13 -195 166 1 240.00 -196 166 2 240.00 -197 167 1 31.36 -198 168 1 1710.81 -199 169 1 135.00 -200 170 1 34.56 -201 171 1 47.50 -202 172 1 20.00 -203 173 1 78.95 -204 174 1 1300.00 -205 175 1 120.00 -206 176 1 729.51 -209 178 2 989.95 -210 179 1 19.60 -211 180 1 8.41 -212 180 2 8.41 -213 181 1 240.00 -214 181 2 240.00 -215 182 1 86.38 -216 183 1 16.00 -217 184 1 94.88 -218 185 1 57.47 -219 186 1 14.99 -220 187 1 80.00 -221 188 1 81.16 -222 189 1 13.75 -223 190 1 22.55 -224 191 1 391.00 -225 192 1 7.49 -226 193 1 89.90 -227 194 1 13.50 -228 195 1 19.94 -229 196 1 48.54 -230 196 2 48.54 -231 197 1 70.97 -232 197 2 70.97 -233 198 1 125.56 -234 199 1 33.89 -235 200 1 19.38 -236 201 1 11.88 -237 202 1 76.77 -238 203 1 81.47 -239 204 1 10.00 -240 205 1 60.00 -241 206 1 11.50 -242 206 2 11.50 -243 207 1 39.94 -244 207 2 39.93 -246 211 1 59.73 -247 211 2 59.72 -248 212 1 60.91 -249 212 2 60.90 -250 213 2 91.35 -251 214 1 12.77 -252 215 1 2175.00 -253 216 1 1000.00 -254 217 1 51.45 -255 218 1 50.00 -256 219 1 34.93 -257 220 1 16.60 -258 221 1 11.50 -259 221 2 11.50 -260 222 1 130.00 -261 222 2 130.00 -262 223 1 30.08 -263 224 1 14.10 -264 225 1 8.75 -265 225 2 8.74 -266 226 1 124.00 -267 209 1 3410.62 -268 227 1 46.28 -269 228 1 250.80 -270 229 1 108.10 -271 230 1 19.85 -272 231 1 44.46 -273 231 2 44.45 -274 232 1 10.89 -275 233 1 17.01 -276 233 2 17.00 -277 234 1 240.00 -278 234 2 240.00 -279 235 1 12.85 -280 236 1 1798.81 -281 237 1 150.00 -282 238 1 535.00 -284 131 1 0.00 -285 152 1 0.00 -286 178 1 0.00 -287 210 1 0.00 -288 213 1 0.00 -289 240 1 46.67 -290 241 1 13.00 -291 242 1 965.00 -292 243 1 14.93 -293 243 2 0.00 -294 244 1 108.03 -295 244 2 0.00 -296 245 1 13.40 -\. - - --- --- Data for Name: expensesShares; Type: TABLE DATA; Schema: public; Owner: expdbuser --- - -COPY public."expensesShares" ("ExpShareID", "ExpID", "UserID", "Share", "Calculated") FROM stdin; -1 1 1 1.00 93.47 -2 2 1 1.00 32.00 -3 3 1 1.00 9.98 -4 4 1 1.00 40.43 -5 5 1 1.00 11.00 -6 6 1 1.00 5.90 -7 7 1 1.00 19.99 -8 8 1 0.50 7.00 -9 8 2 0.50 7.00 -10 9 1 1.00 12.62 -11 10 1 1.00 230.00 -12 11 1 1.00 45.39 -13 12 1 0.50 99.00 -14 12 2 0.50 98.99 -15 13 1 0.50 17.50 -16 13 2 0.50 17.50 -17 14 1 1.00 32.00 -18 15 1 1.00 64.45 -19 16 1 1.00 163.08 -20 17 1 1.00 10.50 -21 18 1 0.50 66.58 -22 18 2 0.50 66.57 -23 19 1 1.00 9.84 -24 20 1 1.00 38.72 -25 21 1 1.00 7.20 -26 22 1 1.00 5.52 -27 23 1 1.00 7.95 -28 24 1 0.50 225.00 -29 24 2 0.50 225.00 -30 25 1 1.00 10.50 -31 26 1 1.00 73.38 -32 27 1 1.00 14.00 -33 28 1 1.00 41.31 -34 29 1 1.00 1769.64 -35 30 1 1.00 15.00 -36 31 1 1.00 45.40 -37 32 1 1.00 20.49 -38 33 1 1.00 165.00 -39 34 1 1.00 38.50 -40 35 1 1.00 32.73 -41 36 1 1.00 49.20 -42 37 1 1.00 59.09 -43 38 1 1.00 50.00 -44 39 1 1.00 6.00 -45 40 1 1.00 44.25 -46 41 1 1.00 12.98 -47 42 1 1.00 18.20 -48 43 1 1.00 25.00 -49 44 1 0.50 8.76 -50 44 2 0.50 8.75 -51 45 1 1.00 316.45 -52 46 1 0.50 116.28 -53 46 2 0.50 116.27 -54 47 1 1.00 9.98 -55 48 1 1.00 68.57 -56 49 1 1.00 49.00 -57 50 1 1.00 31.00 -58 51 1 1.00 14.99 -59 52 1 1.00 21.07 -60 53 1 1.00 84.66 -61 54 1 1.00 5.00 -62 55 1 1.00 27.95 -63 56 1 1.00 7.95 -64 57 1 1.00 50.00 -65 58 1 1.00 136.97 -66 59 1 1.00 17.85 -67 60 1 1.00 36.90 -68 61 1 0.50 225.00 -69 61 2 0.50 225.00 -70 62 1 1.00 104.00 -71 63 1 1.00 63.55 -72 64 1 1.00 19.95 -73 65 1 1.00 17.97 -74 66 1 0.50 74.03 -75 66 2 0.50 74.02 -76 67 1 1.00 23.43 -77 68 1 1.00 32.00 -78 69 1 1.00 57.23 -79 70 1 1.00 70.70 -80 71 1 1.00 1867.06 -81 72 1 1.00 150.00 -82 73 1 1.00 8.40 -83 74 1 1.00 28.65 -84 75 1 1.00 73.00 -85 76 1 1.00 12.62 -86 77 1 0.50 39.45 -87 77 2 0.50 39.45 -88 78 1 0.50 116.50 -89 78 2 0.50 116.50 -90 79 1 0.50 7.30 -91 79 2 0.50 7.30 -92 80 1 1.00 70.00 -93 81 1 1.00 5.70 -94 82 1 1.00 39.64 -95 83 1 0.50 17.50 -96 83 2 0.50 17.50 -97 84 1 1.00 30.47 -98 85 1 1.00 15.75 -99 86 1 1.00 40.00 -100 87 1 1.00 29.85 -101 88 1 1.00 47.12 -102 89 1 1.00 10.00 -103 90 1 1.00 81.01 -104 91 1 0.50 15.55 -105 91 2 0.50 15.55 -106 92 1 0.50 225.00 -107 92 2 0.50 225.00 -108 93 1 1.00 105.74 -109 94 1 1.00 50.00 -110 95 1 1.00 15.75 -111 96 1 1.00 157.50 -112 97 1 1.00 3077.19 -113 98 1 1.00 67.50 -114 99 1 1.00 10.98 -115 100 1 1.00 145.00 -116 101 1 1.00 40.00 -117 102 1 1.00 40.95 -118 103 1 1.00 31.99 -119 104 1 0.50 122.99 -120 104 2 0.50 122.98 -121 105 1 1.00 27.00 -122 106 1 0.50 6.45 -123 106 2 0.50 6.45 -124 107 1 1.00 26.30 -125 108 1 1.00 34.00 -126 109 1 1.00 199.00 -127 110 1 1.00 43.70 -128 111 1 1.00 1370.64 -129 112 1 1.00 34.75 -130 113 1 1.00 11.82 -131 114 1 1.00 32.00 -132 115 1 1.00 50.00 -133 116 1 1.00 24.90 -134 117 1 1.00 46.64 -135 118 1 0.50 48.45 -136 118 2 0.50 48.44 -137 119 1 1.00 9.94 -138 120 1 0.50 240.00 -139 120 2 0.50 240.00 -140 121 1 1.00 50.00 -141 122 1 0.50 8.53 -142 122 2 0.50 8.53 -143 123 1 1.00 75.20 -144 124 1 1.00 13.90 -145 125 1 1.00 48.06 -146 126 1 1.00 1710.81 -147 127 1 1.00 150.00 -148 128 1 1.00 36.64 -149 129 1 0.50 61.50 -150 129 2 0.50 61.49 -151 130 1 1.00 31.69 -152 131 2 1.00 398.63 -153 132 1 1.00 357.75 -154 133 1 1.00 162.50 -155 134 1 1.00 12.00 -156 135 1 0.50 11.88 -157 135 2 0.50 11.88 -158 136 1 0.50 7.97 -159 136 2 0.50 7.97 -160 137 1 1.00 43.74 -161 138 1 1.00 40.00 -162 139 1 1.00 45.25 -163 140 1 1.00 10.00 -164 141 1 0.50 240.00 -165 141 2 0.50 240.00 -166 142 1 0.50 43.83 -167 142 2 0.50 43.82 -168 143 1 1.00 118.49 -169 144 1 1.00 4.77 -170 145 1 1.00 11.08 -171 146 1 1.00 12.55 -172 147 1 1.00 53.43 -173 148 1 1.00 1832.91 -174 149 1 1.00 157.50 -175 150 1 1.00 40.33 -176 151 1 1.00 13.00 -177 152 2 1.00 641.11 -178 153 1 1.00 388.82 -179 154 1 1.00 40.96 -180 155 1 0.50 10.26 -181 155 2 0.50 10.26 -182 156 1 1.00 50.00 -183 157 1 1.00 13.00 -184 158 1 1.00 1200.00 -185 159 1 1.00 22.90 -186 160 1 1.00 129.56 -187 161 1 1.00 47.78 -188 162 1 0.50 7.30 -189 162 2 0.50 7.30 -190 163 1 0.50 11.50 -191 163 2 0.50 11.50 -192 164 1 1.00 76.14 -193 165 1 0.50 34.13 -194 165 2 0.50 34.13 -195 166 1 0.50 240.00 -196 166 2 0.50 240.00 -197 167 1 1.00 31.36 -198 168 1 1.00 1710.81 -199 169 1 1.00 135.00 -200 170 1 1.00 34.56 -201 171 1 1.00 47.50 -202 172 1 1.00 20.00 -203 173 1 1.00 78.95 -204 174 1 1.00 1300.00 -205 175 1 1.00 120.00 -206 176 1 1.00 729.51 -209 178 2 1.00 989.95 -210 179 1 1.00 19.60 -211 180 1 0.50 8.41 -212 180 2 0.50 8.41 -213 181 1 0.50 240.00 -214 181 2 0.50 240.00 -215 182 1 1.00 86.38 -216 183 1 1.00 16.00 -217 184 1 1.00 94.88 -218 185 1 1.00 57.47 -219 186 1 1.00 14.99 -220 187 1 1.00 80.00 -221 188 1 1.00 81.16 -222 189 1 1.00 13.75 -223 190 1 1.00 22.55 -224 191 1 1.00 391.00 -225 192 1 1.00 7.49 -226 193 1 1.00 89.90 -227 194 1 1.00 13.50 -228 195 1 1.00 19.94 -229 196 1 0.50 48.54 -230 196 2 0.50 48.54 -231 197 1 0.50 70.97 -232 197 2 0.50 70.97 -233 198 1 1.00 125.56 -234 199 1 1.00 33.89 -235 200 1 1.00 19.38 -236 201 1 1.00 11.88 -237 202 1 1.00 76.77 -238 203 1 1.00 81.47 -239 204 1 1.00 10.00 -240 205 1 1.00 60.00 -241 206 1 0.50 11.50 -242 206 2 0.50 11.50 -243 207 1 0.50 39.94 -244 207 2 0.50 39.93 -246 211 1 0.50 59.73 -247 211 2 0.50 59.72 -248 212 1 0.50 60.91 -249 212 2 0.50 60.90 -250 213 2 1.00 91.35 -251 214 1 1.00 12.77 -252 215 1 1.00 2175.00 -253 216 1 1.00 1000.00 -254 217 1 1.00 51.45 -255 218 1 1.00 50.00 -257 219 1 1.00 34.93 -259 220 1 1.00 16.60 -260 221 1 0.50 11.50 -261 221 2 0.50 11.50 -262 222 1 0.50 130.00 -263 222 2 0.50 130.00 -264 223 1 1.00 30.08 -265 224 1 1.00 14.10 -266 225 1 0.50 8.75 -267 225 2 0.50 8.74 -268 226 1 1.00 124.00 -269 209 1 1.00 3410.62 -270 227 1 1.00 46.28 -271 228 1 1.00 250.80 -272 229 1 1.00 108.10 -273 230 1 1.00 19.85 -274 231 1 0.50 44.46 -275 231 2 0.50 44.45 -276 232 1 1.00 10.89 -277 233 1 0.50 17.01 -278 233 2 0.50 17.00 -279 234 1 0.50 240.00 -280 234 2 0.50 240.00 -281 235 1 1.00 12.85 -282 236 1 1.00 1798.81 -283 237 1 1.00 150.00 -284 238 1 1.00 535.00 -286 131 1 0.00 0.00 -287 152 1 0.00 0.00 -288 178 1 0.00 0.00 -289 210 1 0.00 0.00 -290 213 1 0.00 0.00 -291 240 1 1.00 46.67 -292 241 1 1.00 13.00 -293 242 1 1.00 965.00 -294 243 1 0.50 7.47 -295 243 2 0.50 7.46 -296 244 1 0.50 54.02 -297 244 2 0.50 54.01 -298 245 1 1.00 13.40 -\. - - --- --- Data for Name: schema_migrations; Type: TABLE DATA; Schema: public; Owner: expdbuser --- - -COPY public.schema_migrations (version, dirty) FROM stdin; -\. - - --- --- Name: categories_CategoryID_seq; Type: SEQUENCE SET; Schema: public; Owner: expdbuser --- - -SELECT pg_catalog.setval('public."categories_CategoryID_seq"', 25, true); - - --- --- Name: expenseTypes_TypeID_seq; Type: SEQUENCE SET; Schema: public; Owner: expdbuser --- - -SELECT pg_catalog.setval('public."expenseTypes_TypeID_seq"', 5, true); - - --- --- Name: expensesPayments_ExpPaymID_seq; Type: SEQUENCE SET; Schema: public; Owner: expdbuser --- - -SELECT pg_catalog.setval('public."expensesPayments_ExpPaymID_seq"', 296, true); - - --- --- Name: expensesShares_ExpShareID_seq; Type: SEQUENCE SET; Schema: public; Owner: expdbuser --- - -SELECT pg_catalog.setval('public."expensesShares_ExpShareID_seq"', 298, true); - - --- --- Name: expenses_ExpID_seq; Type: SEQUENCE SET; Schema: public; Owner: expdbuser --- - -SELECT pg_catalog.setval('public."expenses_ExpID_seq"', 245, true); - - --- --- Name: stores_StoreID_seq; Type: SEQUENCE SET; Schema: public; Owner: expdbuser --- - -SELECT pg_catalog.setval('public."stores_StoreID_seq"', 45, true); - - --- --- Name: users_UserID_seq; Type: SEQUENCE SET; Schema: public; Owner: expdbuser --- - -SELECT pg_catalog.setval('public."users_UserID_seq"', 2, true); - - --- --- PostgreSQL database dump complete --- - -\unrestrict YD6WOUPNPjmsw55mlY0y3tJ8W2L6YjUXHMPUkdckfUq4elWGHIrGHkeyf7x1D0N - diff --git a/src/pgImage/healthcheck.sh b/src/pgImage/healthcheck.sh deleted file mode 100755 index 2c292b2..0000000 --- a/src/pgImage/healthcheck.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e - -pg_isready -U "$ExpDB_USER" -d "$ExpDB_NAME" diff --git a/src/pgImage/start.sh b/src/pgImage/start.sh deleted file mode 100755 index e509645..0000000 --- a/src/pgImage/start.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/sh -set -e - -if [ -z "$(ls -A "$PGDATA")" ]; then - echo "Creating database with:" - echo "DIR: $PGDATA" - echo "USER: $ExpDB_USER" - echo "PASS: $ExpDB_PASS" - echo "NAME: $ExpDB_NAME" - # Initiate PG data directory - initdb \ - --locale=C.UTF-8 \ - --encoding=UTF8 \ - -D "$PGDATA" \ - --data-checksums \ - --username="$UNAME" - - # Set PG to listen on all addresses - sed -ri "s/^#(listen_addresses\s*=\s*)\S+/\1'*'/" "$PGDATA"/postgresql.conf - - # Start PG to add the NC DB - pg_ctl -D "$PGDATA" \ - -o "-c listen_addresses=''" \ - -w start - - # Create the NC database - createUser="CREATE USER $ExpDB_USER WITH PASSWORD '$ExpDB_PASS';" - createDB="CREATE DATABASE $ExpDB_NAME TEMPLATE template0 ENCODING 'UNICODE';" - alterDB="ALTER DATABASE $ExpDB_NAME OWNER TO $ExpDB_USER;" - grantPriv="GRANT ALL PRIVILEGES ON DATABASE $ExpDB_NAME TO $ExpDB_USER;" - psql -d postgres -c "${createUser}" - psql -d postgres -c "${createDB}" - psql -d postgres -c "${alterDB}" - psql -d postgres -c "${grantPriv}" - - # Execute the initial schema - psql -U "$ExpDB_USER" -d "$ExpDB_NAME" -a -f /schema.sql - - pg_ctl -D "$PGDATA" -m fast -w stop - - { echo; echo "host all all 0.0.0.0/0 md5"; } >> "$PGDATA"/pg_hba.conf -fi - -postgres "$@"