This commit is contained in:
2024-04-18 16:53:26 +02:00
commit fdbe6f8eef
11 changed files with 2033 additions and 0 deletions

11
sql/create_account.sql Normal file
View File

@@ -0,0 +1,11 @@
INSERT INTO accounts(
name,
qualifiedName,
description,
type,
balance,
localBalance,
)
VALUES (
'meins', 'Aktiva:meins', 'Mein Geld lol', 'normal', 0.0, 0.0
)

26
sql/create_db.sql Normal file
View File

@@ -0,0 +1,26 @@
CREATE TABLE accounts (
account_id INTEGER PRIMARY KEY,
name TEXT NOT NULL,
qualifiedName TEXT NOT NULL,
description TEXT NOT NULL,
type TEXT NOT NULL,
balance FLOAT NOT NULL,
localBalance FLOAT NOT NULL
);
CREATE TABLE transactions (
transaction_id INTEGER PRIMARY KEY,
postingDate TEXT NOT NULL,
valueDate TEXT,
title TEXT NOT NULL
);
CREATE TABLE transaction_entries (
transaction_id INT,
account_id INT,
amount FLOAT,
label TEXT,
FOREIGN KEY (transaction_id) REFERENCES transactions(transaction_id)
FOREIGN KEY (account_id) REFERENCES account(account_id)
PRIMARY KEY (transaction_id, account_id)
);