diff options
| author | Anders Betts <anders.betts@gmail.com> | 2026-09-20 14:53:46 +0200 |
|---|---|---|
| committer | Anders Betts <anders.betts@gmail.com> | 2026-09-20 14:53:46 +0200 |
| commit | 480640a747b81cb39deb1ec24e6e199a9c837fbe (patch) | |
| tree | a0823b8a06f2043061f4b61b1cd0b060b85ec68e /docs/SCHEMA.md | |
| parent | 8607260080dd1eca2d724d6e5b07622fad2d4ac8 (diff) | |
| download | bokf-480640a747b81cb39deb1ec24e6e199a9c837fbe.tar.gz bokf-480640a747b81cb39deb1ec24e6e199a9c837fbe.zip | |
db: schema v9 for invoicing, vouchers source rebuild
Diffstat (limited to 'docs/SCHEMA.md')
| -rw-r--r-- | docs/SCHEMA.md | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/docs/SCHEMA.md b/docs/SCHEMA.md index 0f360d5..15e375a 100644 --- a/docs/SCHEMA.md +++ b/docs/SCHEMA.md @@ -202,7 +202,8 @@ CREATE TABLE vouchers ( date TEXT NOT NULL CHECK (date LIKE '____-__-__'), description TEXT NOT NULL CHECK (length(description) > 0), source TEXT NOT NULL DEFAULT 'manual' - CHECK (source IN ('manual','agent','sie_import','system','ib')), + CHECK (source IN ('manual','agent','sie_import','system','ib', + 'invoice')), client_ref TEXT, corrects_voucher_id INTEGER, created_at TEXT NOT NULL, @@ -576,7 +577,18 @@ another voucher is posted in between) — clients must not persist it. (thousands of vouchers per year are trivial). Attachments dominate growth; they live in the same file so a snapshot remains a single artifact. -## 14. Seeds +## 14. Invoicing (schema v9) + +`customers`, `invoice_sequence`, `invoices` and `invoice_rows` hold the +customer register, the per-org global invoice number series and issued +invoices with their rows. They are business documents, not ledger data: +invoices are written once at issue and only their status and send fields +change afterwards. The DDL and field semantics are in `docs/INVOICING.md` +§6. `vouchers.source` gained `'invoice'`; widening that CHECK required +rebuilding the table in the v9 migration (foreign keys are disabled for the +migration and `PRAGMA foreign_key_check` runs before they are re-enabled). + +## 15. Seeds | Data | Source | Notes | |---|---|---| |
