Files
double-entry-accounting/accounting.db

70 lines
36 KiB
Plaintext
Raw Normal View History

2025-05-08 16:12:33 +12:00
SQLite format 3@  .K<> <0F><05><0E><0F> <0A> #
<EFBFBD> -<07><05><00>e99<01>etablereconciliation_matchesreconciliation_matches CREATE TABLE reconciliation_matches (
id INTEGER NOT NULL,
report_id INTEGER NOT NULL,
transaction_id INTEGER NOT NULL,
journal_entry_id INTEGER NOT NULL,
match_score NUMERIC(5, 2),
notes VARCHAR(200),
PRIMARY KEY (id),
FOREIGN KEY(report_id) REFERENCES reconciliation_reports (id),
FOREIGN KEY(transaction_id) REFERENCES bank_transactions (id),
FOREIGN KEY(journal_entry_id) REFERENCES journal_entries (id)
)<29>h99<01>ktablereconciliation_reportsreconciliation_reportsCREATE TABLE reconciliation_reports (
id INTEGER NOT NULL,
bank_account_id INTEGER NOT NULL,
start_date DATE NOT NULL,
end_date DATE NOT NULL,
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
status VARCHAR(20),
PRIMARY KEY (id),
FOREIGN KEY(bank_account_id) REFERENCES bank_accounts (id)
)<29>=//<01>)tablebank_transactionsbank_transactionsCREATE TABLE bank_transactions (
id INTEGER NOT NULL,
bank_account_id INTEGER NOT NULL,
date DATE NOT NULL,
amount NUMERIC(15, 2) NOT NULL,
description VARCHAR(200),
reference VARCHAR(100),
status VARCHAR(20),
journal_entry_id INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(bank_account_id) REFERENCES bank_accounts (id),
FOREIGN KEY(journal_entry_id) REFERENCES journal_entries (id)
)<29>3''<01>%tablebank_accountsbank_accountsCREATE TABLE bank_accounts (
id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
account_number VARCHAR(50),
bank_name VARCHAR(100),
currency VARCHAR(3),
ledger_account_id INTEGER,
PRIMARY KEY (id),
FOREIGN KEY(ledger_account_id) REFERENCES accounts (id)
)<29>x33<01>tablejournal_entry_linesjournal_entry_linesCREATE TABLE journal_entry_lines (
id INTEGER NOT NULL,
journal_entry_id INTEGER NOT NULL,
account_id INTEGER NOT NULL,
amount NUMERIC(15, 2) NOT NULL,
is_debit BOOLEAN NOT NULL,
PRIMARY KEY (id),
FOREIGN KEY(journal_entry_id) REFERENCES journal_entries (id),
FOREIGN KEY(account_id) REFERENCES accounts (id)
)<29>q++<01>tablejournal_entriesjournal_entriesCREATE TABLE journal_entries (
id INTEGER NOT NULL,
date DATE NOT NULL,
reference VARCHAR(100),
description VARCHAR(200),
created_at DATETIME DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id)
)<29>2<01>7tableaccountsaccountsCREATE TABLE accounts (
id INTEGER NOT NULL,
name VARCHAR(100) NOT NULL,
account_type VARCHAR(50) NOT NULL,
code VARCHAR(20) NOT NULL,
parent_id INTEGER,
balance NUMERIC(15, 2),
PRIMARY KEY (id),
UNIQUE (code),
FOREIGN KEY(parent_id) REFERENCES accounts (id)
)/Cindexsqlite_autoindex_accounts_1accounts