aboutsummaryrefslogtreecommitdiff
path: root/docs/SCHEMA.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/SCHEMA.md')
-rw-r--r--docs/SCHEMA.md16
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 |
|---|---|---|