Expense category table; built-in categories cannot be deleted; custom categories can be added, edited, or removed
------------------------------------------------------- Categories table (source: categories API) ------------------------------------------------------- @table-comment categories Expense category table; built-in categories cannot be deleted; custom categories can be added, edited, or removed
| Name | Type | Constraints | Nullable | Default | Comment | |
|---|---|---|---|---|---|---|
| PKAI | id | INTEGER | - | NO | - | Unique category identifier; auto-increment primary key |
| name | TEXT | - | NO | - | Category name; unique constraint | |
| icon | TEXT | - | YES | - | Category icon emoji (optional) | |
| is_default | INTEGER | - | NO | 0 | Whether built-in category (0 = custom, 1 = built-in) | |
| created_at | TEXT | - | NO | (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) | Created at, ISO 8601 format |
| Name | Type | Fields |
|---|---|---|
| - | UNIQUE | name |
Expense records table; stores each user expense entry
------------------------------------------------------- Expense records table (source: records API) ------------------------------------------------------- @table-comment records Expense records table; stores each user expense entry
| Name | Type | Constraints | Nullable | Default | Comment | |
|---|---|---|---|---|---|---|
| PKAI | id | INTEGER | - | NO | - | Unique record identifier; auto-increment primary key |
| amount | INTEGER | - | NO | - | Amount in yuan, stored as integer hundredths of a yuan to avoid floating-point precision issues | |
| category_id | INTEGER | FK → categories(id) |
NO | - | Category ID; foreign key to categories | |
| created_at | TEXT | - | NO | (strftime('%Y-%m-%dT%H:%M:%fZ', 'now')) | Created at, ISO 8601 format | |
| remark | TEXT | - | YES | - | Note (optional, max 200 characters) |
| Name | Type | Fields |
|---|---|---|
| idx_records_created_at | INDEX | created_at |
| idx_records_category_id | INDEX | category_id |
User settings table; stores passcode lock and other preferences
------------------------------------------------------- Settings table (source: settings API) ------------------------------------------------------- @table-comment settings User settings table; stores passcode lock and other preferences
| Name | Type | Constraints | Nullable | Default | Comment | |
|---|---|---|---|---|---|---|
| value | TEXT | - | NO | - | Setting value (password-related values stored hashed) |
Password salt table; stores the salt for each password
------------------------------------------------------- Password-related auxiliary table (optional; for password history, etc.) ------------------------------------------------------- @table-comment password_salt Password salt table; stores the salt for each password
| Name | Type | Constraints | Nullable | Default | Comment | |
|---|---|---|---|---|---|---|
| PK | id | INTEGER | CHECK id = 1 |
NO | - | Salt identifier; currently only a single password is supported |
| salt | TEXT | - | NO | - | Random salt, Base64-encoded |