summaryrefslogtreecommitdiff
path: root/docs/SCHEMA.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/SCHEMA.md')
-rw-r--r--docs/SCHEMA.md18
1 files changed, 11 insertions, 7 deletions
diff --git a/docs/SCHEMA.md b/docs/SCHEMA.md
index f2e93ac..9818e1c 100644
--- a/docs/SCHEMA.md
+++ b/docs/SCHEMA.md
@@ -560,11 +560,12 @@ another voucher is posted in between) — clients must not persist it.
## 12. Migrations and versioning
- `meta(key TEXT PRIMARY KEY, value TEXT)` holds `schema_version` (integer)
- and `created_at`. Current version: **10** (v10 adds the payroll tables and
- the `payroll`/`payroll_tax` voucher sources, v9 adds the invoicing tables
- and `invoice`, v8 the two bank reconciliation tables, v7 makes attachments
- append-only, v3 replaces the seeded moms rules with the corrected mapping;
- v2 adds the two template tables).
+ and `created_at`. Current version: **11** (v11 adds the employee e-mail,
+ v10 adds the payroll tables and the `payroll`/`payroll_tax` voucher
+ sources, v9 adds the invoicing tables and `invoice`, v8 the two bank
+ reconciliation tables, v7 makes attachments append-only, v3 replaces the
+ seeded moms rules with the corrected mapping; v2 adds the two template
+ tables).
- Migrations are forward-only, applied automatically at daemon start, each in
one transaction. Before the first migration statement a consistent
`VACUUM INTO` snapshot is written to
@@ -599,7 +600,7 @@ change afterwards. The DDL and field semantics are in `docs/INVOICING.md`
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. Payroll (schema v10)
+## 15. Payroll (schema v10, employees.e-mail v11)
The employee register and the monthly runs. `personal_no_enc` holds the
AES-256-GCM envelope (`enc:v1:<nonce>:<ciphertext>`, `src/secret.c`) under
@@ -609,7 +610,9 @@ money is in the immutable voucher of each run. `vouchers.source` gained
`'payroll'` (the monthly run) and `'payroll_tax'` (the payment to the tax
account); widening that CHECK required rebuilding the table in the v10
migration, exactly like v9 (foreign keys are disabled for the migration and
-`PRAGMA foreign_key_check` runs before they are re-enabled).
+`PRAGMA foreign_key_check` runs before they are re-enabled). v11 adds the
+employee `email` (`ALTER TABLE`, fresh databases already carry it) used as
+the default lönebesked recipient.
```sql
CREATE TABLE employees (
@@ -628,6 +631,7 @@ CREATE TABLE employees (
active INTEGER NOT NULL DEFAULT 1 CHECK (active IN (0,1)),
created_at TEXT NOT NULL,
updated_at TEXT,
+ email TEXT NOT NULL DEFAULT '',
UNIQUE (org_id, id)
) STRICT;