Architecture

Database and ownership

Understand AlphaLedger’s MySQL records, constraints, and system-of-record boundaries.

Storage rules

AlphaLedger uses MySQL 8/InnoDB. All timestamps are UTC and all money uses fixed-scale DECIMAL columns with ISO currency codes.

Core records

  • users with unique usernames, business_settings, hashed sessions, login_attempts, and five-minute password_reset_tokens
  • projects and project_assignments
  • time_entries, time_breaks, timer_locks, and break_locks
  • time_entry_revisions and pay_accruals
  • audit_events
  • integration_installations, remote_people, outbox_messages, inbox_messages, sync_conflicts, and remote_financial_statuses

timer_locks.user_id and break_locks.time_entry_id are primary keys, providing database-level one-running-timer and one-open-break guarantees without generated columns that make portable restores unreliable. Projects record origin, PA identity/version, code, and preserved local alias. Approved entries retain a project display-name snapshot for historical stability.

Migration policy

The clean-install baseline is database/baseline.sql. Every later SQL migration uses a unique numeric prefix and is recorded with a SHA-256 checksum. Applied migrations are immutable.