starting transaction

This commit is contained in:
2024-06-01 14:47:24 +02:00
parent db3b1e6a11
commit 3813e11258
6 changed files with 696 additions and 11 deletions

View File

@@ -1,7 +1,7 @@
CREATE TABLE accounts (
account_id integer PRIMARY KEY,
number integer NOT NULL,
name text NOT NULL,
qualifiedName text NOT NULL,
qualifiedName text NOT NULL UNIQUE,
description text NOT NULL,
type TEXT NOT NULL,
balance float NOT NULL,
@@ -17,9 +17,9 @@ CREATE TABLE transactions (
CREATE TABLE transaction_entries (
transaction_id int,
account_id int,
account_name text NOT NULL,
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)
FOREIGN KEY (transaction_id) REFERENCES transactions (transaction_id) FOREIGN KEY (account_name) REFERENCES account (account_qualifiedName) PRIMARY KEY (transaction_id, account_id)
);