Simpl-Resultat/src-tauri/src/database
le king fu a1c3dafcd0
All checks were successful
PR Check / rust (pull_request) Successful in 23m1s
PR Check / frontend (pull_request) Successful in 2m25s
feat(balance): schema & migrations v14/v15 + types (securities, holdings, account.kind) (#210)
Foundations for 'détail par titre' (Étape 2), purely additive — v1-v13 are
untouched and their checksums stay intact.

v14 (balance_holdings_schema.sql, applied verbatim via BALANCE_HOLDINGS_SCHEMA):
- balance_securities: instrument catalogue, symbol normalized + COLLATE NOCASE
  UNIQUE (no case-dupes), asset_type CHECK ('stock','crypto'), currency CAD.
- balance_snapshot_holdings: per-security breakdown of a snapshot line, FK to
  balance_snapshot_lines (CASCADE) + balance_securities (RESTRICT), value
  denormalized, UNIQUE(snapshot_line_id, security_id) + 2 indexes.

v15 (inline): balance_accounts gains kind ('simple'|'detailed', NOT NULL
DEFAULT 'simple', CHECK) + detailed_since DATE; backfills kind='detailed' on
accounts under a priced category. Two single-column ADDs (SQLite), idempotent.

consolidated_schema.sql brought to parity: 2 tables + 2 indexes + kind/
detailed_since columns + the v15 backfill (no-op for the 4 simple starters,
reproduced for future priced starters).

TS types: BalanceAccountKind, BalanceSecurity, BalanceSnapshotHolding (+
WithSecurity join variant); BalanceAccount gains kind + detailed_since;
BalanceAccountWithCategory exposes both kind and category_kind.

Tests: +9 (v14/v15 via V14_SQL/V15_SQL consts + db_through_v13 helper, plus a
consolidated parity test). cargo test 89 passed, npm build + 552 vitest green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-06 12:52:55 -04:00
..
balance_holdings_schema.sql feat(balance): schema & migrations v14/v15 + types (securities, holdings, account.kind) (#210) 2026-06-06 12:52:55 -04:00
balance_schema.sql feat(balance): add migration v9 schema (5 tables, 7 indexes, seed) 2026-04-25 14:31:50 -04:00
consolidated_schema.sql feat(balance): schema & migrations v14/v15 + types (securities, holdings, account.kind) (#210) 2026-06-06 12:52:55 -04:00
mod.rs feat(balance): schema & migrations v14/v15 + types (securities, holdings, account.kind) (#210) 2026-06-06 12:52:55 -04:00
schema.sql fix: restore schema.sql to exact v0.2.4 bytes for migration checksum (v0.2.7) 2026-02-14 17:23:36 +00:00
seed_categories.sql Fix app stuck on spinner after v0.4.0 update (GH #9) 2026-02-26 21:54:42 -05:00