everything working without error codes

This commit is contained in:
2024-06-05 18:07:08 +02:00
parent 542ea2fdf1
commit db5c4dfdca
3 changed files with 134 additions and 57 deletions

View File

@@ -1,2 +1,6 @@
INSERT INTO accounts (name, qualifiedName, description, type, balance, localBalance,)
VALUES ('meins', 'Aktiva:meins', 'Mein Geld lol', 'normal', 0.0, 0.0)
INSERT INTO accounts (number, name, qualifiedName, description, type)
VALUES (1000, 'Aktiva', 'Aktiva', 'Mein Geld lol', 'meta');
INSERT INTO accounts (number, name, qualifiedName, description, type, parentAccount)
VALUES (1001, 'Bargeld', 'Aktiva:Bargeld', 'Mein Geld lol', 'default', 'Aktiva');
INSERT INTO accounts (number, name, qualifiedName, description, type)
VALUES (1002, 'Passiva', 'Passiva', 'Mein Geld lol', 'default');

View File

@@ -2,10 +2,9 @@ CREATE TABLE accounts (
number integer NOT NULL,
name text NOT NULL,
qualifiedName text NOT NULL UNIQUE,
parentAccount text,
description text NOT NULL,
type TEXT NOT NULL,
balance float NOT NULL,
localBalance float NOT NULL
);
CREATE TABLE transactions (
@@ -20,6 +19,6 @@ CREATE TABLE transaction_entries (
account_name text NOT NULL,
amount float,
label text,
FOREIGN KEY (transaction_id) REFERENCES transactions (transaction_id) FOREIGN KEY (account_name) REFERENCES account (account_qualifiedName) PRIMARY KEY (transaction_id, account_id)
FOREIGN KEY (transaction_id) REFERENCES transactions (transaction_id) FOREIGN KEY (account_name) REFERENCES accounts (qualifiedName) PRIMARY KEY (transaction_id, account_name)
);