CREATE TABLE account (

id TEXT PRIMARY KEY,
name TEXT NOT NULL

);

CREATE TABLE transaction (

id TEXT PRIMARY KEY,
description TEXT NOT NULL,
datetimestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
category_id INTEGER REFERENCES category(id),

);

CREATE TABLE journal (
id INTEGER PRIMARY KEY AUTOINCREMENT,
transaction_id INTEGER REFERENCES transaction(id),
account_id TEXT REFERENCES account(id),
amount REAL NOT NULL,
is_credit BOOLEAN NOT NULL
);

CREATE TABLE category (
id INTEGER PRIMARY KEY AUTOINCREMENT,
parent_id INTEGER REFERENCES category(id) NOT NULL DEFAULT 0,
name TEXT NOT NULL,
DESCRIPTION TEXT
);
