Add v6 database schema DDL (sections 2-3)
Two schema files covering all v6 tables:
- 001-tables.sql: Organizations (denormalized OOD), Users, Roles/RBAC,
FinancialAccounts (with OwnerUserId, native currency, bitcoin fields),
FinancialTransactions (with OrganizationSequenceId, BlockchainHash),
FinancialTransactionRows (with foreign currency, bitcoin derivation),
Dependencies, Tags/TagSets/TagTypes, Budgets
- 002-tables-apar.sql: ExpenseClaims (with VatCents, groups),
InboundInvoices (with native currency, bitcoin satoshis),
OutboundInvoices + Items (with credit links, VAT),
Payouts, PaymentGroups, Payments, Refunds, Documents,
FinancialAccountDocuments, Currencies, ExchangeRateSnapshots +
Datapoints (micro-BTC scaling), CryptoChains, HotWalletAddresses,
HotWalletUtxos, MailQueue, MailTemplates, EventQueue, SystemSettings
Key v5→v6 differences:
- ObjectOptionalData EAV denormalized to first-class columns
- FinancialTransactionRowsNativeCurrency merged into Rows table
- People → Users (simplified, no geography/membership)
- utf8mb4 throughout, no legacy latin1
- Amount (double) columns removed; AmountCents (bigint) only
- Budget tables unified (annual + monthly in one table)
- v5 FlatData → SystemSettings
Also updates data-migration spec for mysqldump-based workflow.
Made-with: Cursor